Commit graph

1179 commits

Author SHA1 Message Date
Wenzhe Wang
1dd321e021
refactor(linter): remove all old parse_general_jest_fn_call in jest rules (#1232) 2023-11-12 18:57:30 +08:00
magic-akari
9c0aafcd1c
fix(parser): Disallow ReservedWord in NamedExports (#1230)
- fix: #1222

---------

Co-authored-by: Boshen <boshenc@gmail.com>
2023-11-12 10:52:02 +00:00
Wenzhe Wang
f775488102
refactor(lint): replace parse_jest_fn_* methods in eslint-plugin-jest(no-standalone-expect) rule (#1231) 2023-11-12 18:51:24 +08:00
Wenzhe Wang
18a35252fc
feat(linter): reimplement eslint-plugin-jest(no-identical-title) (#1229) 2023-11-12 18:43:27 +08:00
Dunqing
1eef241788
feat(transformer/react-jsx): support for throwing SpreadChildrenAreNotSupported error (#1234) 2023-11-12 18:37:19 +08:00
Wenzhe Wang
72b3bdf619
refactor(linter): replace all is_type_of_jest_fn_call (#1228) 2023-11-12 18:37:03 +08:00
Wenzhe Wang
efc346e56a
refactor(linter): migrate eslint-plugin-jest(no-alias-method) (#1226) 2023-11-12 11:33:25 +08:00
Hao Cheng
82c1769836
feat(linter): eslint-plugin-unicorn/no-abusive-eslint-disable (#1125)
This PR implements the
[eslint-plugin-unicorn/no-abusive-eslint-disable](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-abusive-eslint-disable.md)
rule.

Tests taken from
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/test/no-abusive-eslint-disable.mjs.

Related issue: #684
2023-11-12 11:32:14 +08:00
Wenzhe Wang
071311a898
refactor(lint): migrate eslint-plugin-jest(expec-expect) (#1225) 2023-11-12 11:26:31 +08:00
Dunqing
39e608734f
feat(transformer/react-jsx): support for throwing ImportSourceCannotBeSet error (#1224) 2023-11-12 11:17:23 +08:00
Wenzhe Wang
b4ce2b5f9b
refactor(linter): remove unused logic in resolve_to_jest_fn (#1208)
I copied parse_jest_fn.rs file to parse_jest_fn_new.rs, the new file only changed `resolve_to_jest_fn` now. The new version of `parse_jest_fn_call` doesn't need to get the original of node, and I changed its parameters. I tried to add it to the old file, but it will influence other files, so I created a new file for it. I will delete the old file after all rules migrated.
2023-11-12 11:15:23 +08:00
Boshen
efb3fd45bf
Release oxc_resolver v0.5.3 2023-11-11 23:26:07 +08:00
zhangpeng
0fa24bcafc
feat(resovler): impl Into for IOError (#1223)
patch for rspack issue
[#4564](https://github.com/web-infra-dev/rspack/issues/4564)
2023-11-11 23:21:51 +08:00
Dunqing
b7e8feb7c1
feat(transformer/react-jsx): support throw valueless-key error (#1221) 2023-11-11 20:10:07 +08:00
Dunqing
a22ced78f1
feat(transformer/react-jsx): implement throwIfNamespace option (#1220) 2023-11-11 13:31:45 +08:00
Dunqing
48242367bb
fix(transformer/react-jsx): missing import jsxs in nested fragment (#1218) 2023-11-11 02:45:42 +00:00
Dunqing
a0f40cb058
fix(transformer/react-jsx): missing default options when plugin without config (#1219) 2023-11-11 10:38:28 +08:00
magic-akari
8afb81aa34
fix(parser): ASI of async class member (#1214)
Co-authored-by: Boshen <boshenc@gmail.com>
2023-11-10 16:21:51 +00:00
Dunqing
d9b450414b
feat(transformer/react-jsx): when the source type is a script, use require to import the react (#1207) 2023-11-10 18:17:31 +08:00
Dunqing
3e15fa624b
fix(transformer/react-jsx): undetectable comments in multiline comments (#1211) 2023-11-10 08:20:55 +00:00
Boshen
eca98cf2ed
s/web-infra-dev/oxc-project 2023-11-10 14:30:18 +08:00
Boshen
90ff0ddbe0
refactor: change @oxidation-compiler/napi to oxc-parser (#1209) 2023-11-10 06:17:05 +00:00
Dunqing
8c624abf9c
feat(transformer/react-jsx): throw the pragma and pragmaFrag cannot be set when runtime is automatic error (#1196)
close: #1194

Here's a rough implementation of my idea of throwing an error.
2023-11-10 12:50:54 +08:00
Dunqing
b65094b995
fix(transformer/react-jsx): no need to wrap the Array when there is only one correct child element (#1205) 2023-11-10 10:52:37 +08:00
Wenzhe Wang
5a4e61132e
fix(linter): detect assert function in Await Expression (#1202)
fixes: #1199
2023-11-09 13:53:24 +08:00
Boshen
d82ba5b523
feat(cli): run oxlint with no file arguments (#1201)
closes #1190

See: `https://github.com/eslint/eslint/issues/14308`
2023-11-09 11:22:13 +08:00
Cameron
a503586d3e
feat(linter) eslint plugin unicorn prefer spread (#1186) 2023-11-09 09:43:29 +08:00
Cameron
e5d281e8e7
feat(linter) eslint plugin unicorn: prefer optional catch binding (#1188) 2023-11-09 09:40:49 +08:00
Hao Cheng
49b6be607e
fix(linter): fix handling of repeated eslint-disable comments (#1200)
This PR fixes how the linter handles repeated `eslint-disable` comments.
As shown by examples below, in ESLint, repeated `eslint-disable`
comments are allowed and all errors below the first `eslint-disable`
comment are ignored.

The first new test case in ESLint Playground:
https://eslint.org/play/#eyJ0ZXh0IjoiICAgICAgICAvKiBlc2xpbnQtZGlzYWJsZSAqL1xuICAgICAgICAgICAgZGVidWdnZXI7XG4gICAgICAgIC8qIGVzbGludC1kaXNhYmxlICovXG4gICAgICAgICAgICBkZWJ1Z2dlcjsiLCJvcHRpb25zIjp7ImVudiI6e30sInJ1bGVzIjp7Im5vLWRlYnVnZ2VyIjpbImVycm9yIl19LCJwYXJzZXJPcHRpb25zIjp7ImVjbWFGZWF0dXJlcyI6e30sImVjbWFWZXJzaW9uIjoibGF0ZXN0Iiwic291cmNlVHlwZSI6Im1vZHVsZSJ9fX0=

The second new test case in ESLint Playground:

https://eslint.org/play/#eyJ0ZXh0IjoiICAgICAgICAvKiBlc2xpbnQtZGlzYWJsZSBuby1kZWJ1Z2dlciAqL1xuICAgICAgICAgICAgZGVidWdnZXI7XG4gICAgICAgIC8qIGVzbGludC1kaXNhYmxlIG5vLWRlYnVnZ2VyICovXG4gICAgICAgICAgICBkZWJ1Z2dlcjsiLCJvcHRpb25zIjp7ImVudiI6e30sInJ1bGVzIjp7Im5vLWRlYnVnZ2VyIjpbImVycm9yIl19LCJwYXJzZXJPcHRpb25zIjp7ImVjbWFGZWF0dXJlcyI6e30sImVjbWFWZXJzaW9uIjoibGF0ZXN0Iiwic291cmNlVHlwZSI6Im1vZHVsZSJ9fX0=
2023-11-09 09:34:50 +08:00
Boshen
48de83b20c
Release oxc_resolver v0.5.2 2023-11-08 17:03:17 +08:00
Boshen
63c242f765
feat(resolver): strip trailling commas from tsconfig.json (#1198)
closes #1195
2023-11-08 08:57:06 +00:00
Dunqing
7d85492a03
feat(transformer/react-jsx): support the sourceType is a script (#1192) 2023-11-08 15:15:00 +08:00
Dunqing
28c0b85646
feat(transformer/react-jsx): support @jsxFrag annotation (#1189) 2023-11-08 11:35:40 +08:00
Boshen
26fd0069d8
chore(linter): change categories of some rules and also add some help messages
no-new-array -> suspicious
prefer-add-event-listener -> suspicious
prefer-date-now -> pedantic
2023-11-08 11:32:41 +08:00
Cameron
8e8508b5f4
feat(linter) eslint plugin unicorn: prefer regex test (#1187) 2023-11-08 10:45:12 +08:00
Wenzhe Wang
1cc449f97e
refactor(linter): reduce the lookup times of Call Expression in Jest rules (#1184) 2023-11-08 08:20:57 +08:00
cin
6e76669a3f
feat(lint): remove unnecessary check (#1185) 2023-11-08 04:32:18 +08:00
cin
9369424d8e
feat(linter): eslint-plugin-jest: no-hooks (#1172) 2023-11-07 21:52:36 +08:00
Dunqing
633c469d2d
feat(transformer/react-jsx): support @jsx annotation (#1182) 2023-11-07 20:30:26 +08:00
秦宇航
008b0e650c
feat(linter) eslint-plugin-import: no-amd (#1171) 2023-11-07 20:28:39 +08:00
Dunqing
3cb7c0b199
feat(transformer/react-jsx): support pragmaFrag option (#1181) 2023-11-07 10:34:15 +00:00
Dunqing
4ed0813f9b
feat(transformer/react-jsx): support pragma option (#1180) 2023-11-07 18:26:54 +08:00
Cameron
5636bf9207
feat(linter) eslint plugin unicorn: no useless fallback (#1176) 2023-11-07 18:24:12 +08:00
Dunqing
bf23d87848
feat(transformer/react-jsx): support @jsxImportSource annotation (#1179) 2023-11-07 17:29:38 +08:00
Dunqing
f0e452a599
feat(transformer): support importSource option in react_jsx (#1115) 2023-11-07 16:42:08 +08:00
Cameron
b16c298b35
feat(linter) eslint plugin unicorn: prefer add event listener (#1175) 2023-11-07 10:59:09 +08:00
Cameron
8f93891dc7
feat(linter) eslint plugin unicorn: no new buffer (#1174) 2023-11-07 10:58:04 +08:00
Yiming Pan
033a112a83
feat(linter): support eslint(default-case-last) (#1156) 2023-11-07 10:52:39 +08:00
Wenzhe Wang
6a03775c49
chore(benchmark): reopen jest and jsx-a11y for benchmark (#1169) 2023-11-07 10:48:16 +08:00
Cameron
9b66646278
feat(linter) eslint-plugin-unicorn: prefer blob reading methods (#1168) 2023-11-06 12:59:28 +00:00