Commit graph

1113 commits

Author SHA1 Message Date
Wenzhe Wang
4e9260ec03
feat: basic enable plugin (#1154) 2023-11-05 21:46:30 +08:00
Wenzhe Wang
e9b88e0b45
refactor: split parse_jest_fn_call (#1152) 2023-11-05 20:47:09 +08:00
Cameron
b81d79b64b
refactor(eqeqeq) rename eq_eq_eq to eqeqeq (#1151)
From #1146

---------

Co-authored-by: Boshen <boshenc@gmail.com>
2023-11-05 00:25:04 +00:00
Cameron
28a9574190
feat(linter) eslint plugin unicorn Prefer TypeError (#1149)
Co-authored-by: Boshen <boshenc@gmail.com>
2023-11-05 00:02:12 +00:00
Cameron
b8cc460c5c
feat(linter) eslint plugin unicorn: prefer date now (#1150) 2023-11-05 07:47:47 +08:00
Cameron
f8be0b4cf2
feat(linter) eslint plugin unicorn prefer string trim start end (#1148) 2023-11-05 07:43:41 +08:00
Cameron
3bf374eda8
feat(linter) eslint plugin unicorn: no invalid remove evt listner (#1147) 2023-11-05 07:42:37 +08:00
Cameron
3eb4b9b1c4
feat(linter) parse configuration for unicorn/filename-case (#1145) 2023-11-05 07:41:16 +08:00
Boshen
38c90db0fe
ci: check unused dependencies via cargo machete (#1143) 2023-11-04 14:45:44 +00:00
Wenzhe Wang
f71cb9f1da
feat(transform): support TemplateLiteral of babel/plugin-transform-template-literals (#1132)
Co-authored-by: Boshen <boshenc@gmail.com>
2023-11-03 22:19:44 +08:00
Wei Zhu
278a1d6fee
fix(linter/jsx_key): ignore ObjectProterty nodes (#1139)
Elements inside `ObjectProperty` should be ignored in this case.

Reproducible link
https://web-infra-dev.github.io/oxc/playground/?code=3YCAAIBkgICAgICAgICxG0qZRraXT4%2BHfMNjiJBtGiljae%2FxPDG%2BJO0RwxenJsd5%2BlR3yNLJ5vlfyo6dyWxkTY9Mm3O0cA9BM891YAt9c0xItb72Q7pTMe3YerC2J%2FisL1OUPS%2FtM4wqycc0tXOSR6ljCgWmr5gaAISHdIxbyoQxaSumV472wrVF2NwbxJnOjXh3fgSlgA%3D%3D
2023-11-03 21:56:51 +08:00
Boshen
203cf37695
feat(transformer/react): read comment pragma @jsxRuntime classic / automatic (#1133)
closes #1120
2023-11-03 11:10:11 +08:00
Trevor Manz
1aa4b4e024
feat(linter): Add rule eslint-plugin-jsx-a11y(alt-text) (#1126)
Adds first `eslint-plugin-jsx-a11y` rule.

Had to comment out a couple of tests with TODOs related to evaluating
logical expressions and polymorphic components, but I think these are
largely edge cases for detecting validity of alt text. The most
important cases are covered.
2023-11-03 11:02:33 +08:00
Boshen
69150d812c
refactor(transformer): move Semantic into Transformer (#1130) 2023-11-02 13:10:15 +08:00
Hao Cheng
fa4e0cae81
fix(linter): fix covered span of eslint-disable-next-line comments (#1128)
This PR fixes the covered span (specifically the stop position) of
`eslint-disable-next-line` comments.

Note that the covered span is not very accurate in the case of
multi-line comments. For example, the start and stop positions of the
`eslint-disable-next-line` comment in the example below are marked in
comments.

```js
            /* eslint-disable-next-line no-debugger --
             * Here's a very long description about why this configuration is necessary
             * along with some additional information
            **/
//           ^start
            debugger;
//                  ^stop
            debugger;
```

The stop position has an offset of one or two depending on the line
ending (\r\n or \n). I am not sure if this would be a problem.
2023-11-02 09:28:39 +08:00
Boshen
103268be98
chore(linter): move all import plugin rules to nursery (#1113) 2023-10-30 21:04:57 +08:00
Boshen
407e406f86
feat(linter): change some rules pedantic and improve help message (#1112) 2023-10-30 17:42:15 +08:00
Dunqing
144c881be5
fix(linter/no-render-return-value): remove duplicate test case (#1111)
Added in #1109
2023-10-30 09:37:14 +00:00
Boshen
cf1265453b
chore(linter/no_unescaped_entities): demote to pedantic (#1110)
The code is not wrong
2023-10-30 17:30:32 +08:00
Boshen
4975440e1b
fix(linter/no_render_return_value): fix false positive when nested inside an arrow expression (#1109) 2023-10-30 17:23:11 +08:00
Boshen
8b11592a1f
feat(linter): demote prefer_array_flat_map to style (#1108) 2023-10-30 17:04:51 +08:00
Dunqing
d4c05ff7b3
feat(linter): support unicorn/prefer-query-selector (#1068)
Refer to
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-query-selector.md

link: #684
2023-10-30 17:04:35 +08:00
Boshen
6da5a3f216
feat(cli): print execution time in seconds when greater than 1 second (#1107) 2023-10-30 16:35:40 +08:00
Boshen
b703c0c5b5
feat(linter/no_children_prop): point the span to "children" (#1106) 2023-10-30 16:19:30 +08:00
Boshen
22c31cef3f
fix(linter/no_empty_file): point to start of file instead of the entire file (#1105)
Since it may contain lots of comments, which gives us a screenful of comments
2023-10-30 16:11:37 +08:00
Boshen
cb2407de24
chore(litner): demote some of the rule from correctness (#1104) 2023-10-30 16:02:27 +08:00
Boshen
b4739e5540
fix(linter): fix panic in no_unescaped_entities (#1103) 2023-10-30 15:52:32 +08:00
Boshen
a455c81db6
fix(linter): revert changes to JSX attribute strings (#1101) 2023-10-30 15:26:04 +08:00
dependabot[bot]
bf1e3b5440
chore(deps): bump the dependencies group with 4 updates (#1100) 2023-10-30 15:09:28 +08:00
Boshen
4e218331c2
refactor(cli): clean up code around codeowners (#1099) 2023-10-30 11:21:41 +08:00
Cameron
cef075df17
fix(linter) Report error instead of panicing if the file fails to open (#1098)
closes #1093


e.g.

```
RUST_BACKTRACE=full cargo run  --bin=oxc_cli lint -D=suspicious -D=style -D=restriction -D=pedantic -D=nursery -D=correctness -A=no-useless-escape ./tasks/coverage/typescript/tests/cases/compiler/corrupted.ts
```

Results in:
```

  × Failed to open file
  help: Failed to open file "./tasks/coverage/typescript/tests/cases/compiler/corrupted.ts" with error "stream did not contain valid UTF-8"

Finished in 10ms on 1 file with 126 rules using 12 threads.
Found 0 warnings and 1 error.
```
2023-10-30 09:53:28 +08:00
Cameron
0194dbd79d
fix(linter) Fix panic when using ban ts comment on conformace tests (#1097)
```
RUST_BACKTRACE=full cargo run --bin=oxc_cli lint -D=suspicious -D=style -D=restriction -D=pedantic -D=nursery -D=correctness  ./tasks/coverage/typescript/tests/cases/conformance/directives/ts-expect-error.ts --threads=1
```

currently panics, entering unreachable code
2023-10-30 09:52:46 +08:00
Cameron
0bcba4fba2
fix(linter) Fix panic on no useless escape (#1092)
Closes #1041
2023-10-30 09:51:04 +08:00
Cameron
bd34dc7453
fix(linter): Fix panic on no_mixed_operators rule (#1094) 2023-10-29 21:28:38 +08:00
Boshen
262631da62
feat(transformer/react): implement fixup_whitespace_and_decode_entities (#1091) 2023-10-29 18:11:51 +08:00
Boshen
6295f9ce18
fix(ast): jsx attribute value and text child should be jsx string (#1089) 2023-10-29 15:32:24 +08:00
Boshen
1051f15005
feat(transformer/jsx): escape xhtml in jsx attributes (#1088) 2023-10-29 15:16:50 +08:00
Boshen
1ad2dca45a
fix(transformer/react_jsx): add imports to the top body (#1087) 2023-10-29 15:05:52 +08:00
Wenzhe Wang
cef78accf0
feat(codegen): indent inner class (#1085) 2023-10-29 15:03:30 +08:00
Boshen
e8a4e81298
feat(transformer): implement some of jsx decode entities (#1086) 2023-10-29 14:57:39 +08:00
Wenzhe Wang
094dfa5604
feat: support filter exec snap (#1084)
Co-authored-by: Boshen <boshenc@gmail.com>
2023-10-29 05:39:32 +00:00
u9g
1704a76f6f
Codeowners filtering (#1083)
closes #1066
2023-10-29 13:30:20 +08:00
Boshen
fe4a5ed535
fix(transformer): fix position of inserted react import statement (#1082) 2023-10-28 23:05:02 +08:00
Boshen
0856111bea
feat(transformer): implement more of react transform attributes (#1081) 2023-10-28 22:47:39 +08:00
Boshen
96332c85c6
feat(transformer): import jsxs when children is static (#1080) 2023-10-28 17:25:25 +08:00
Boshen
c7a04f42e7
refactor(transformer): remove returning None from transform functions (#1079) 2023-10-28 16:55:38 +08:00
Boshen
d411258be4
feat(transformer): finish transform jsx attribute value (#1078) 2023-10-28 16:46:33 +08:00
Boshen
5fb27fbe8a
feat(transformer): implement key extraction for react automatic (#1077) 2023-10-28 16:34:54 +08:00
Boshen
394ed358f6
feat(transformer): implement react get_attribute_name (#1076) 2023-10-28 16:25:03 +08:00
Boshen
f60fd65f65
feat(transfomer): implement react has_key_after_props_spread (#1075) 2023-10-28 16:17:11 +08:00