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
Boshen
d6ba8910ba
feat(transformer): add props null to React.createElement ( #1074 )
2023-10-28 15:59:46 +08:00
Mariusz Antas
0a0e93b55d
feat(linter): eslint-plugin-unicorn require-number-to-fixed-digits-argument ( #1073 )
...
Rule taken from https://github.com/web-infra-dev/oxc/issues/684 .
Tests taken from:
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/test/require-number-to-fixed-digits-argument.mjs
Another rule! 😄
2023-10-28 10:47:27 +08:00
Boshen
e16e7e44e0
feat(transformer): implement react transform attributes ( #1071 )
2023-10-28 02:12:23 +00:00
Mariusz Antas
162c720ef1
feat(linter): eslint-plugin-unicorn switch-case-braces ( #1054 )
...
Rule taken from https://github.com/web-infra-dev/oxc/issues/684 .
Tests taken from:
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/test/switch-case-braces.mjs
2023-10-27 00:28:06 +00:00
Wenzhe Wang
b5bfc361fc
feat(transform): transform jsx element name ( #1070 )
2023-10-27 08:13:40 +08:00
Boshen
d9ba532ca6
refactor(transformer): add an empty SPAN utility for creating AST nodes ( #1067 )
2023-10-26 18:43:53 +08:00
Boshen
d8f1a7fce6
feat(transformer): start implementing react jsx transform ( #1057 )
2023-10-26 17:27:05 +08:00
Cameron
94d3e28aac
fix(linter) fix incorrect reporting for no_useless_escape ( #1062 )
2023-10-26 15:40:45 +08:00
magic-akari
1b64e48ee1
feat(transformer): strip implicit type import for typescript ( #1058 )
2023-10-26 11:07:30 +08:00
Dunqing
59660a53b8
fix(linter): noTemplateLiterals configuration in no_string_refs rule not working ( #1063 )
...
I didn't notice that the `noTemplateLiterals` configuration didn't work
due to the lack of test cases
2023-10-26 11:03:37 +08:00
Cameron
5029dfde5a
feat(linter) eslint-plugin-unicorn - prefer-logical-operator-over-ternary ( #1064 )
2023-10-26 11:03:12 +08:00
Dunqing
47837e5396
feat(linter): support react/no-string-refs ( #1055 )
...
I noticed that there is already a
https://github.com/web-infra-dev/oxc/pull/1053 with the same rule PR.
This PR is currently only used to compare it
However, it seems to be missing a lot of detailing, such as not handling
the react component for es6, which is caused by the lack of test cases.
Also, the `get_parent_es5_component` and `get_parent_es6_component`
function is very useful for other react rules. If #1053 is merged, I
will create another PR to add them
2023-10-25 23:08:33 +08:00
Cameron
5cfeda5022
feat(linter) eslint-plugin-unicorn - text-encoding-identifier-case ( #1051 )
...
part of #684
---------
Co-authored-by: Boshen <boshenc@gmail.com>
2023-10-25 15:02:50 +00:00
Boshen
f53a5326a5
chore(linter): deny clippy::print_stdout
2023-10-25 22:45:14 +08:00
Cameron
db83f66ed0
feat(linter): eslint-plugin-unicorn - no-empty-file ( #1052 )
2023-10-25 22:32:37 +08:00
Trevor Manz
ebab50e0ce
feat(linter): eslint-plugin-react no-string-refs ( #1053 )
...
Co-authored-by: Boshen <boshenc@gmail.com>
2023-10-25 03:53:46 +00:00
Dunqing
d8f07ca71d
feat(linter): support react/no-render-return-value ( #1042 )
...
refer to
https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-render-return-value.md
2023-10-24 09:34:20 +00:00
Boshen
af1a76bafa
feat(transformer): implement some of needs_explicit_esm for typescript ( #1047 )
...
Co-authored-by: magic-akari <akari.ccino@gmail.com>
2023-10-24 17:30:01 +08:00
Boshen
a442fad3b7
feat(semantic): bind function expression name ( #1049 )
...
closes #1018
We'll eventually recover the mangling tests, which should cover this
change.
2023-10-24 17:25:12 +08:00
Cameron
64988f484b
feat(linter): eslint-plugin-react(no-unescaped-entities) ( #1044 )
2023-10-24 16:41:44 +08:00
Cameron
a48e880914
reactor(linter): Refactor jsx key rule to use static_property_info ( #1043 )
2023-10-24 10:00:33 +08:00
Hao Cheng
a2e40ef623
feat(linter): eslint-plugin-react/no-find-dom-node ( #1031 )
...
This PR implements the
[eslint-plugin-react/no-find-dom-node](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-find-dom-node.md )
rule for oxlint.
2023-10-24 01:52:27 +00:00
Cameron
2483e5cbf1
fix(linter) Improve span for jsx key ( #1040 )
...
closes #1034
2023-10-23 21:45:57 +08:00
Boshen
854b55a3e6
feat(codegen): json strings proposal ( #1039 )
2023-10-23 18:29:30 +08:00
Boshen
b6b6853e41
fix(linter): point to the opening fragment for jsx_no_useless_fragment
...
In real codebases the fragment child may be a wall of text that gets
printed on the screen.
2023-10-23 10:24:10 +08:00
Cameron
7edc7f0690
feat(linter) eslint-plugin-react(jsx-no-comment-text-nodes) ( #1027 )
2023-10-23 09:42:09 +08:00
Cameron
d129425b67
feat(linter) eslint-plugin-react: no dangerously set inner html ( #1029 )
2023-10-23 09:39:12 +08:00
Cameron
76ac9cd4c5
fix(lexer) Fix spans for jsx children ( #1030 )
...
Closes #1026
2023-10-22 22:44:19 +08:00
Boshen
01671729b7
chore(span,index): update documentation
2023-10-22 11:23:36 +08:00
Cameron
dea9b7cbac
feat(linter): eslint-plugin-react: jsx-no-duplicate-props ( #1024 )
...
Co-authored-by: Boshen <boshenc@gmail.com>
2023-10-21 15:25:32 +00:00
Sg
25247e3839
feat(linter): eslint/no-fallthrough (nursery)
2023-10-21 23:22:56 +08:00
Cameron
f13fc2287a
feat(linter): eslint-plugin-react/no-useless-fragment ( #1021 )
2023-10-21 23:16:46 +08:00
Cameron
854dfe0dea
feat(linter) eslint-plugin-react/no-children-prop ( #1015 )
2023-10-21 21:08:37 +08:00
Cameron
c4a2084f27
fix(linter) Fix panic when linting declaration files ( #1014 )
...
When linting declaration files, it panics here
6628fc8d9c/crates/oxc_linter/src/rules/eslint/no_global_assign.rs (L57)
with this error:
```
index out of bounds: the len is 0 but the index is 0
```
Because it expects the array to have the root scope id inside (non zero
len)
0fcad27515/crates/oxc_semantic/src/scope.rs (L52-L54)
2023-10-21 09:25:32 +08:00
Boshen
d31a667e23
feat(transformer): drop this parameter from typescript functions ( #1019 )
2023-10-20 23:15:06 +08:00
Cameron
ee134f022c
fix(linter): incorrect reporting for jsx_key ( #1020 )
...
tested on a different repo and noticed an issue (despite passing all of
the eslint test cases)
If we are in the following scenario:
```tsx
const columns: ColumnDef<User>[] = [
{
accessorKey: 'firstName',
header: ({ column }) => <DataTableColumnHeader column={column} title="First Name" />,
cell: ({ row }) => <div>{row.getValue('firstName')}</div>,
enableSorting: true,
enableHiding: false,
},
]
```
Previously an error would be reported however it did not make sense to
as the object has to be mapped again before it is displayed in react
(hence lets check there instead)
2023-10-20 21:50:58 +08:00
Boshen
dfee8539f0
feat(transformer): add utils to make logical_assignment_operators pass ( #1017 )
2023-10-20 16:27:23 +08:00
Cameron
3f06335172
feat(linter) eslint-plugin-react/jsx-key ( #1016 )
...
https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-key.md
2023-10-20 15:52:24 +08:00
Boshen
06efb77d57
chore(minifier): add --whitespace option to example
2023-10-20 11:33:53 +08:00
Boshen
c95f2e0937
fix(linter): fix panic with strip_prefix ( #1013 )
...
fixes #1011
2023-10-20 10:05:32 +08:00
Boshen
46a5c42c75
refactor(transformer): add TransformerCtx struct for easier access to symbols and scopes
2023-10-19 16:19:27 +08:00
Boshen
94792e9153
refactor(ast): split syntax_directed_operations into separate files
2023-10-19 14:58:31 +08:00
Jason Miller
1aa95fa6d6
Fix oxlint --quiet suppressing errors ( #1008 )
...
As explained by the comment in source, --quiet should only suppress
warning output.
Please double-check that I haven't done something totally wrong here, I
don't know Rust.
2023-10-18 11:00:27 +08:00
Boshen
052661d75e
refactor(transform_conformance): improve report format
2023-10-17 17:41:34 +08:00
Boshen
1b3b100475
feat(transformer_conformance): read plugins options from babel options.json ( #1006 )
...
This PR correctly handles babel `options.json` such as
https://github.com/babel/babel/blob/main/packages/babel-plugin-transform-nullish-coalescing-operator/test/fixtures/assumption-noDocumentAll/options.json
2023-10-17 14:52:51 +08:00
Cameron
88cf98a258
feat(linter): eslint-plugin-unicorn(throw-new-error) ( #1005 )
...
part of https://github.com/web-infra-dev/oxc/issues/684
[throw-new-error](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/throw-new-error.md )
2023-10-17 09:15:10 +08:00
Boshen
678db1d955
feat(transformer): ES2020 Nullish Coalescing Operator ( #1004 )
...
The test runner needs an update for reading options.jon, which I'll work
on in the up coming PR.
2023-10-16 21:45:58 +08:00