Commit graph

1582 commits

Author SHA1 Message Date
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
dependabot[bot]
6738066bfc
chore(deps): bump actions/setup-node from 3 to 4 (#1102) 2023-10-30 15:06:45 +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
Iván Ovejero
b2eeb5e38c
fix(playground): Enable linting on first load (#1096) 2023-10-29 23:12:22 +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
fe1bbaf0d4
chore(codegen): update snapshot (#1090) 2023-10-29 16:04:04 +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
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
Wenzhe Wang
ae74e08141
chore(tasks): only use bun to run babel exec.js (#1060) 2023-10-25 22:33:20 +08:00
Cameron
db83f66ed0
feat(linter): eslint-plugin-unicorn - no-empty-file (#1052) 2023-10-25 22:32:37 +08:00
Dunqing
8816649e3c
feat(rulegen): escape from to \” (#1059) 2023-10-25 22:31:09 +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
Wenzhe Wang
7192520d2b
feat(transformer_conformance): use bun to run babel exec.js test cases (#1012)
closes #999 

Co-authored-by: Boshen <boshenc@gmail.com>
2023-10-25 03:06:07 +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