Boshen
fc1592bc97
refactor(semantic): remove all #[dead_code[ from tester
2024-01-25 20:27:46 +08:00
Boshen
889837704c
feat(semantic): cfg prototype ( #2019 )
...
Co-authored-by: U9G <git@u9g.dev>
2024-01-25 20:19:35 +08:00
underfin
2794064eef
feat(transfrom): transform-json-strings ( #2168 )
...
The pr intends to implement the plugin
`babel-plugin-transform-json-strings`. But here is only mutate
`Directive`, the `StringLiteral` is not implement. It need to changed
the `StringLiteral` printer.
I'm intend to add the raw of `StringLiteral`, it will be mutate at
plugin, and using the `raw` to print `StringLiteral`. If you other
ideas, please let me know.
---------
Co-authored-by: Boshen <boshenc@gmail.com>
2024-01-25 10:39:02 +00:00
Boshen
7f114d4d98
chore(linter): clean up unused snapshots
2024-01-25 17:01:17 +08:00
Boshen
ed87cbf1f0
chore(linter): remove type info rule consistent-type-exports
2024-01-25 16:56:23 +08:00
Yuji Sugiura
c18619ee4c
fix(linter): use correct rule name ( #2169 )
...
Found by accident but it should be.
- [x] react/jsx-no-comment-text-nodes
- `jsx-no-comment-textnodes` is correct
-
https://github.com/jsx-eslint/eslint-plugin-react/blob/master/lib/rules/jsx-no-comment-textnodes.js
- [x] react/no-dangerously-set-inner-html
- `no-danger` is correct
-
https://github.com/jsx-eslint/eslint-plugin-react/blob/master/lib/rules/no-danger.js
- [x] react-perf/no-jsx-as-prop
- Correct name has `jsx-` prefix
-
https://github.com/cvazac/eslint-plugin-react-perf/tree/master/lib/rules
- [x] react-perf/no-new-array-as-prop
- The same as above
- [x] react-perf/no-new-function-as-props
- The same as above
- [x] react-perf/no-new-object-as-prop
- The same as above
- [x] jsx-a11y/tab-index-no-positive
- `tabindex-no-positive` is correct
-
https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/src/rules/tabindex-no-positive.js
- [x] jsx-a11y/role-support-aria-props
- `role-suports-aria-props` is correct
-
https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/src/rules/role-supports-aria-props.js
- - -
+1,
- typescript/consistent-type-exports
- Listed in `disable-type-checked` config == This is type checking rule
but implemented
-
8622286207/packages/eslint-plugin/src/configs/disable-type-checked.ts (L12)
- Should remove it..?
2024-01-25 16:54:52 +08:00
underfin
989ab88bc6
fix(codegen): print Directive original string ( #2157 )
...
> A Use Strict Directive may not contain an EscapeSequence or
LineContinuation.
It is `Use Strict Directive` spec, but the `expression` of `Directive`
isn't original string value, it has error if using it to codegen, so
here using `directive` of `Directive` to codegen and not to escape it.
Here is crashed test cases.
``` js
'use str\
ict';
```
The babel will print the original string, I follow it and avoid using
`print_str` because it will escape string.
I also changed some code using the `expression` of `Directive` to check
`Use Strict Directive` .
2024-01-25 15:24:05 +08:00
cin
ac1d318dc3
feat(linter): eslint-plugin-jest: prefer-called-with ( #2163 )
...
Rule Detail:
[link](https://github.com/jest-community/eslint-plugin-jest/blob/main/src/rules/prefer-called-with.ts )
2024-01-25 14:01:51 +08:00
Dunqing
51cecbb3ea
refactor(transformer/decorators): align the implementation of all versions ( #2159 )
2024-01-25 13:11:24 +08:00
cin
38914308e7
feat(linter): eslint: no-void ( #2162 )
...
Rule Detail:
[link](https://github.com/eslint/eslint/blob/main/lib/rules/no-void.js )
2024-01-25 12:40:30 +08:00
hjio
a5d7c67982
feat(linter) eslint-plugin-react/jsx-no-target-blank ( #2149 )
...
#1022 try to implement `jsx-no-target-blank`
* code:
https://github.com/jsx-eslint/eslint-plugin-react/blob/master/lib/rules/jsx-no-target-blank.js
* doc:
https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
* test:
https://github.com/jsx-eslint/eslint-plugin-react/blob/master/tests/lib/rules/jsx-no-target-blank.js
---------
Co-authored-by: huangjunjie.coder <huangjunjie.coder@bytedance.com>
2024-01-25 09:42:05 +08:00
Maurice Nicholson
26022322ff
fix(linter): explicit-length-check inside ternary ( #2165 )
2024-01-25 08:09:35 +08:00
Dunqing
b261e86ea9
refactor(ast): improve simple_assignment_target_identifier and simple_assignment_target_member_expression method ( #2153 )
...
Based on current usage, I think returning AssignmentTarget is better.
2024-01-24 11:24:27 +08:00
Dunqing
7f89bfea0d
feat(transformer/decorators): support version 2023-05 ( #2152 )
2024-01-24 11:19:29 +08:00
Dunqing
04b401cbfd
feat(transformer/decorators): support transform the class decorators in export declaration ( #2145 )
2024-01-24 11:13:29 +08:00
Dunqing
9e598ff650
feat(transformer): add decorators plugin ( #2139 )
2024-01-24 11:09:19 +08:00
Wenzhe Wang
1ee6d8cea9
feat(codegen): move string test to codegen ( #2150 )
2024-01-23 23:49:36 +08:00
Boshen
16a192cf1a
chore: try fix broken env_logger
2024-01-23 15:03:53 +08:00
renovate[bot]
0be0a234ce
chore(deps): update cargo ( #2138 )
2024-01-23 14:48:04 +08:00
overlookmotel
777352e2ba
fix(transformer): always create valid identifiers ( #2131 )
...
I'm not familiar with the transformer, so not 100% sure what this
function does. But from the name `create_valid_identifier`, I'm guessing
that `-` is a mistake - it's not a valid character to have in
identifiers.
If I've misunderstood, please feel free to close this.
2024-01-23 12:35:41 +08:00
overlookmotel
0dc1804a52
refactor(syntax): don't re-export unicode_id_start
2024-01-23 11:05:17 +08:00
overlookmotel
ee949fc78d
refactor(transformer): use is_identifier_part
2024-01-23 11:05:17 +08:00
overlookmotel
040ee192c4
refactor(transformer): use is_identifier_name from oxc_syntax
2024-01-23 11:05:17 +08:00
overlookmotel
bc7ea0bedb
refactor(parser): make is_identifier methods consistent
2024-01-23 11:05:17 +08:00
overlookmotel
27aaff2bef
refactor(syntax): ASCII tables static not const ( #2128 )
...
A small nit: `ASCII_CONTINUE` is used in multiple places, so it's
preferable that it's a `static` not a `const` so it only gets included
in the binary once, rather than once for each usage.
Only makes a tiny difference on benchmarks (~0.1 ms), but change seems
worthwhile anyway just to be more "good practice".
2024-01-22 21:49:54 +08:00
Valerii Smirnov
6d808a673c
feat(linter): linter-eslint-plugin-import/no-named-as-default ( #2109 )
...
#1117
Code:
https://github.com/import-js/eslint-plugin-import/blob/main/src/rules/no-named-as-default.js
Tests:
https://github.com/import-js/eslint-plugin-import/blob/main/tests/src/rules/no-named-as-default.js
Docs:
https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-named-as-default.md
2024-01-22 19:55:05 +08:00
Boshen
a978639718
feat(cli): disallow path pointing to parent directories ( #2125 )
...
Linting parent directories introduces undefined behavior because
the intention is not clear. This is a future proof precaution.
closes #1887
2024-01-22 17:52:57 +08:00
Boshen
d00c44c484
fix(linter): allow [...new Array(n)] in no-useless-spread ( #2124 )
...
closes #1735
2024-01-22 17:10:58 +08:00
Boshen
d90db3afe0
feat(linter): promote no-new-array to correctness with better help message ( #2123 )
...
relates #1735
2024-01-22 16:57:57 +08:00
Hulk
20a34b5294
feat: introduce --react-perf-plugin CLI flag, update rules to correctness ( #2119 )
...
https://github.com/oxc-project/oxc/issues/2041#issuecomment-1903316240
Closes #2041
2024-01-22 16:45:32 +08:00
Boshen
69fecac733
feat(linter): eslint config jsonc support ( #2121 )
2024-01-22 16:19:31 +08:00
Dunqing
766ca63aa0
refactor(ast): rename RestElement to BindingRestElement ( #2116 )
...
close : #2115
2024-01-22 14:28:35 +08:00
Dunqing
8bccdab2e9
refactor(semantic): add binder for FormalParameters and RestElement, replacing the binder for FormalParameters ( #2114 )
...
Similar with #2013 .
This way we will be able to find the corresponding Ast accurately.
The snapshots look a little strange but the change is expected.
2024-01-22 14:23:39 +08:00
Hulk
5ca07bcb09
feat(linter): eslint-plugin-react-perf ( #2086 )
...
Relates #2041
Closes #2042
Closes #2043
Closes #2044
Closes #2045
2024-01-22 13:53:48 +08:00
overlookmotel
4f59c4fdfc
refactor(syntax): reformat identifier byte tables ( #2111 )
...
Not a substantive change, just reformatting the ASCII byte tables in
`oxc_syntax`.
In my opinion, this makes them easier to read.
2024-01-22 13:45:12 +08:00
kaykdm
b1608420cd
feat(linter): support eslint config in nextjs eslint ( #2107 )
...
related: https://github.com/oxc-project/oxc/issues/1929
Support Next.js eslint config settings.
- [custom settings
](https://nextjs.org/docs/app/building-your-application/configuring/eslint#custom-settings )
- also handle Next.js eslint rule name mapping
these are need before implementing [this
rule](https://nextjs.org/docs/messages/no-html-link-for-pages )
2024-01-22 11:39:39 +08:00
msdlisper
2228aa8ced
fix(linter): jsx_a11y/img-redundant linter enable test case( #2112 )
...
Enables the case where `settings` is used.
Part of #1141
2024-01-21 18:31:20 +00:00
overlookmotel
36c718ee82
feat(tasks): benchmarks for lexer ( #2101 )
...
This PR adds benchmarks for the lexer. I'm doing some work on optimizing
the lexer and I thought it'd be useful to see the effects of changes in
isolation, separate from the parser.
These benchmarks may not be ideal to keep long-term, but for now it'd be
useful.
In order to do so, it's necessary for `oxc_parser` crate to expose the
lexer, but have done that without adding it to the docs, and using an
alias `__lexer`.
2024-01-21 14:32:50 +00:00
cin
16b32616c4
feat(linter): eslint-plugin-jest: no-restricted-jest-methods ( #2091 )
...
Rule Detail:
[link](https://github.com/jest-community/eslint-plugin-jest/blob/main/src/rules/no-restricted-jest-methods.ts )
---------
Co-authored-by: Wenzhe Wang <mysteryven@gmail.com>
2024-01-21 17:00:48 +08:00
Wenzhe Wang
142f84f654
fix(linter): not use new_inline with flexible str ( #2106 )
2024-01-21 16:37:27 +08:00
cin
4adce6fb45
feat/linter: (eslint-plugin-jest): no-restricted-matchers ( #2090 )
...
Rule Detail:
[link](https://github.com/jest-community/eslint-plugin-jest/blob/main/src/rules/no-restricted-matchers.ts )
2024-01-21 16:06:00 +08:00
Cameron
51183b801c
fix(linter) panic in prefer-native-coercion-function ( #2100 )
...
closes #2098
2024-01-21 01:52:00 +08:00
Boshen
59e29f286a
chore(parser): explain the reason for omitting "}" and ">" in jsx text lexer ( #2097 )
...
closes #2094
2024-01-20 23:03:44 +08:00
Boshen
3f2b48f1a9
refactor(parser): remove useless string builder from jsx text lexer ( #2096 )
...
relates #2094
2024-01-20 22:34:57 +08:00
Dunqing
8e43eeffe7
refactor(semantic): improve declare symbol logic in FormalParameters ( #2088 )
2024-01-20 20:59:11 +08:00
msdlisper
a36813405b
refactor(linter): perfect the scope linter ( #2092 )
...
perfect the scope linter for #1141
2024-01-20 10:46:35 +08:00
Boshen
2f5afff9bd
fix(parser): fix crash on TSTemplateLiteralType in function return position ( #2089 )
...
```
interface Helpers {
inspect(): `~~~~\n${string}\n~~~~`;
}
```
2024-01-19 23:14:05 +08:00
Dunqing
721a869b6e
feat(linter): improve no_redeclare rule implementation ( #2084 )
2024-01-19 20:10:06 +08:00
Boshen
a9e2158362
Update README
2024-01-19 18:39:07 +08:00
Yuji Sugiura
2f1e1e2e46
feat/tasks: expose linter RULES and use it for listing ( #2083 )
...
Part of #2020 , follow up of #2081 .
2024-01-19 16:45:00 +08:00