Boshen
c6a19aa478
refactor(linter): remove unused serde features ( #7738 )
2024-12-09 09:16:32 +00:00
Tyler Earls
62f0a22b89
test(linter): port react-jsx-uses-vars rules to no_unused_vars ( #7731 )
...
I added the test cases from
[eslint-plugin-react/jsx-uses-vars](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/tests/lib/rules/jsx-uses-vars.js )
to a `react.rs` file in the `no_unused_vars` tests module.
After adding the new tests, they immediately passed without any source
code changes required. It would seem that the linter already supported
this rule, but now there will be tests to support it.
---------
Co-authored-by: Cameron <cameron.clark@hey.com>
2024-12-08 22:18:23 +00:00
dalaoshu
02f9903211
test(linter): add regression tests for import/namespace ( #7723 )
...
Related to #7696
2024-12-08 15:35:14 +08:00
Boshen
ad27b20dc3
fix(linter): only resolve esm files for import plugin ( #7720 )
...
closes #7696
cjs files do not work at all.
2024-12-07 17:30:45 +00:00
dalaoshu
5e6053f35a
fix(linter): false positive in eslint/yoda ( #7719 )
2024-12-07 15:12:30 +00:00
Boshen
b9a2b35e5a
refactor(linter): remove aho-corasick ( #7718 )
2024-12-07 12:34:41 +00:00
oxc-bot
5f4f6d140b
release(oxlint): v0.14.1 ( #7692 )
2024-12-06 13:06:54 +08:00
Boshen
fd0935cfcd
feat(linter): change react/rules-of-hooks category to pedantic ( #7691 )
...
Although this rule is recommended by the React team,
it does not report incorrect or wrong code for the `correctness` category.
When turned on by default, I find false positive warnings confusing,
I cannot tell whether my code is wrong or the rule implementation is
wrong - see examples in the affine repo.
```
x eslint-plugin-react-hooks(rules-of-hooks): React Hook "use" cannot be called at the top level. React Hooks must be called in a React function component or a custom React Hook function.
,-[packages/backend/server/src/config/affine.self.ts:80:1]
79 | /* Captcha Plugin Default Config */
80 | ,-> AFFiNE.use('captcha', {
81 | | turnstile: {},
82 | | challenge: {
83 | | bits: 20,
84 | | },
85 | `-> });
86 |
`----
```
2024-12-06 03:49:32 +00:00
camc314
7cee065249
fix(linter): panic in yoda ( #7679 )
...
fixes #7674
2024-12-06 03:33:38 +00:00
camc314
f029090d65
docs(linter): update rule documentation ( #7684 )
2024-12-05 16:17:46 +00:00
camc314
be9863a415
test(linter): add more tests fo rules-of-hooks ( #7683 )
...
closes #6651
2024-12-05 15:18:14 +00:00
camc314
4e489bdf0a
docs(linter): update rule documentation ( #7681 )
...
part of #6050
2024-12-05 14:09:30 +00:00
Cameron
56fe5f8bb9
docs(linter): update rule documentation ( #7680 )
...
part of #6050
2024-12-05 20:14:42 +08:00
Boshen
e64fd9556d
feat(linter): map .js to .ts when resolving with tsconfig.json ( #7675 )
...
fixes #6913
closes #6906
2024-12-05 09:07:23 +00:00
Boshen
b8dc333ed4
feat(syntax): add ExportEntry::is_type ( #7676 )
2024-12-05 09:02:18 +00:00
Boshen
6ae178e0b9
fix(linter): ignore type references in no-undef ( #7670 )
...
fixes #7007
fixes #7008
2024-12-05 05:36:54 +00:00
overlookmotel
a0973dcb5a
refactor(linter): use BigIntLiteral::raw field ( #7660 )
...
No need to slice source text to get raw value of `BigIntLiteral`. It already has a `raw` field.
2024-12-05 04:23:14 +00:00
camc314
3711a8e342
refactor(linter): rename is_same_reference to is_same_expression ( #7654 )
2024-12-05 04:15:15 +00:00
Song Gao
ebc80f6749
refactor(ast)!: change 'raw' from &str to Option<Atom> ( #7547 )
...
Fix #7254
Changed all "raw" properties of literal types (if they have this property) to `Option<Atom>`.
---------
Co-authored-by: overlookmotel <theoverlookmotel@gmail.com>
2024-12-05 00:34:45 +00:00
tbashiyy
bd9d38a9a0
feat(linter): Implement eslint:yoda ( #7559 )
...
In this PR, implement
[eslint:yoda](https://eslint.org/docs/latest/rules/yoda )
ref: https://github.com/oxc-project/oxc/issues/479
2024-12-04 15:58:21 +00:00
camc314
a14e76aade
feat(linter): report identical logical expressions in const-comparisons ( #7630 )
2024-12-04 03:10:17 +00:00
camc314
afe1e9b929
feat(linter): enhance const-comparisons for more cases ( #7628 )
2024-12-04 02:59:56 +00:00
camc314
b445654fbd
refactor(linter): use get_inner_expression in const-comparisons ( #7627 )
2024-12-04 02:59:55 +00:00
camc314
fcc2546f9f
fix(linter): move no-unused-expressions from TS to eslint ( #7624 )
2024-12-04 02:26:47 +00:00
Alexander S.
29db060c78
fix(linter): detect typescript eslint alias rules ( #7622 )
...
closes #7233
2024-12-04 10:16:00 +08:00
camc314
e824501a21
fix(linter): false positive in exhaustive-deps ( #7626 )
2024-12-04 01:58:25 +00:00
camc314
8a68ef4c3b
fix(linter): update reporting spans for exhaustive-deps ( #7625 )
2024-12-04 01:58:23 +00:00
camc314
543df6e3a8
fix(linter): fix false positives in exhaustive-deps ( #7615 )
...
part of https://github.com/oxc-project/oxc/issues/7246
2024-12-03 23:54:22 +00:00
Boshen
4eb87eadbf
feat(linter): RulesOfHooks from nursery to correctness ( #7607 )
2024-12-03 14:15:43 +00:00
camc314
6dd71c6d05
test(linter): port eslint tests to no-unused-expressions ( #7611 )
2024-12-03 13:15:49 +00:00
camc314
e80214c74f
fix(linter): fix false positives in rules-of-hooks ( #7606 )
...
closes https://github.com/oxc-project/oxc/issues/7572
should remove all false positives from this rule
2024-12-03 12:19:00 +00:00
Cameron
3dc46a80c9
fix(linter): no-unused-expressions false positive with arrow fn expressions ( #7585 )
...
fixes https://github.com/oxc-project/oxc/issues/7584
2024-12-03 09:48:50 +08:00
Alexander S.
810671a4a0
fix(linter): detect vitest jest alias rules ( #7567 )
...
closes #7240
2024-12-03 09:46:05 +08:00
Boshen
f0e7acc68b
refactor(syntax): change ModuleRecord::not_esm to has_module_syntax ( #7579 )
2024-12-02 09:32:57 +00:00
Boshen
18519dea33
refactor(syntax): remove ModuleRecord::export_default ( #7578 )
...
This value can be derived.
2024-12-02 09:17:57 +00:00
Boshen
d476660b0b
refactor(syntax): remove ModuleRecord::exported_bindings_duplicated because it is a syntax error ( #7577 )
2024-12-02 08:48:01 +00:00
Boshen
17663f55d3
refactor(syntax): remove ModuleRecord::export_default_duplicated because it is a syntax error ( #7576 )
2024-12-02 08:19:59 +00:00
camc314
275d6256bb
feat(linter): output rules to json array ( #7574 )
...
closes #7517
cc @Sysix
2024-12-02 03:17:57 +00:00
camc314
4e3044e225
fix(linter): rules-of-hooks fix false positive with default export ( #7570 )
...
closes #7555
2024-12-02 03:09:30 +00:00
camc314
cb1f8e6e03
chore(linter): update rules_of_hooks test cases ( #7569 )
...
updates test cases based on what's currently in react's repo
2024-12-02 03:09:30 +00:00
Boshen
79014ffb1d
refactor(syntax): clean up ModuleRecord ( #7568 )
2024-12-01 14:49:04 +00:00
oxc-bot
c61a383e8c
release(oxlint): v0.14.0 ( #7563 )
...
## [0.14.0] - 2024-12-01
### Features
- 32f860d linter: Add support for ignorePatterns property within config
file (#7092 ) (Nicholas Rayburn)
- 053bc08 linter: Implement typescript/no-unused-expressions (#7498 )
(camc314)
- 60b28fc linter: Implement typescript/consistent-generic-constructors
(#7497 ) (camc314)
- bd0693b linter: Allow lint rules with the same name (#7496 ) (camc314)
- 2ac9f96 linter: Typescript/no-inferrable-types (#7438 ) (camc314)
- 8d89fdc linter: Add eslint/prefer-spread (#7112 ) (tbashiyy)
### Bug Fixes
- 123b5b7 linter: False positive in
`typescript/consistent-type-definitions` (#7560 ) (dalaoshu)
- cc078d6 linter: Add missing error message prefix to
`eslint/no-const-assign` (Boshen)
- 17c0dd8 linter: Fix `jsx_no_script_url` doc failed to build (Boshen)
### Performance
- 6cc7a48 linter: Use `OsString` for module cache hash (#7558 ) (Boshen)
- 6655345 linter: Use `FxDashMap` for module cache (#7522 )
(overlookmotel)
### Documentation
- a6b0100 linter: Fix config example headings (#7562 ) (Boshen)
### Refactor
- 0f3f67a linter: Add capability of adding semantic data to module
record (#7561 ) (Boshen)
- 8392177 linter: Clean up the runtime after the module record change
(#7557 ) (Boshen)
- 823353a linter: Clean up APIs for `ModuleRecord` (#7556 ) (Boshen)
- f847d0f linter: Call `str::ends_with` with array not slice (#7526 )
(overlookmotel)
- 2077ff9 linter: Remove `once_cell` (#7510 ) (Boshen)
- 169b8bf linter, syntax: Introduce type alias `FxDashMap` (#7520 )
(overlookmotel)
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2024-12-01 16:47:21 +08:00
Boshen
a6b0100501
docs(linter): fix config example headings ( #7562 )
...
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2024-12-01 16:31:22 +08:00
Boshen
0f3f67a05a
refactor(linter): add capability of adding semantic data to module record ( #7561 )
...
closes #5814
closes #5816
2024-12-01 08:14:43 +00:00
dalaoshu
123b5b7f38
fix(linter): false positive in typescript/consistent-type-definitions ( #7560 )
...
closes #7552
2024-12-01 16:03:29 +08:00
Boshen
6cc7a48b52
perf(linter): use OsString for module cache hash ( #7558 )
2024-12-01 05:47:40 +00:00
Boshen
839217770c
refactor(linter): clean up the runtime after the module record change ( #7557 )
2024-12-01 05:32:41 +00:00
Boshen
823353a6fc
refactor(linter): clean up APIs for ModuleRecord ( #7556 )
2024-12-01 04:48:42 +00:00
Boshen
c2ced15dfd
feat(parser,linter)!: use a different ModuleRecord for linter ( #7554 )
...
The parser returns a simple `ModuleRecord` that is allocated in the arena for performance reasons.
The linter uses a more complicated, `Send` + `Sync` `ModuleRecord` that will hold more cross-module information.
The next step is to return more esm information from the parser to eliminated the need of the `oxc_module_lexer` crate.
2024-11-30 16:02:01 +00:00
Boshen
0be5233c84
refactor(semantic)!: remove ModuleRecord from Semantic ( #7548 )
...
`ModuleRecord` will eventually be moved to be linter specific thing for cross module data sharing, which means we can add more data to it.
2024-11-29 16:30:54 +00:00