Skip to content

Commit ead5309

Browse files
committed
fix(linter)!: remove react from default plugin set (#11382)
This is a breaking change, but currently, how we check whether a react rule should run is opaque and unclear. For example, the `react/forward-ref-uses-ref` rule checks whether the framework flags `FrameworkFlags::React` is enabled, however this is never set to true meaning that this rule can never run. https://github.com/oxc-project/oxc/blob/bbb7eb1a27ac280febc3702bc5e7eb131dcc005a/crates/oxc_linter/src/rules/react/forward_ref_uses_ref.rs#L99-L101 This PR removes the react rule group from the default plugins, if users which to use the react plugin, they just have to add it to the plugins array. I have made thie change before 1.0, so hopefully the fact that it's breaking is ok.
1 parent 8a34447 commit ead5309

File tree

43 files changed

+45
-47
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+45
-47
lines changed

apps/oxlint/src/snapshots/_--ignore-path fixtures__linter__.customignore --no-ignore [email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ working directory:
1414
help: Use the isNaN function to compare with NaN.
1515
1616
Found 1 warning and 0 errors.
17-
Finished in <variable>ms on 1 file with 101 rules using 1 threads.
17+
Finished in <variable>ms on 1 file with 87 rules using 1 threads.
1818
----------
1919
CLI result: LintSucceeded
2020
----------

apps/oxlint/src/snapshots/_--ignore-pattern _____.js --ignore-pattern _____.vue [email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ arguments: --ignore-pattern **/*.js --ignore-pattern **/*.vue fixtures/linter
66
working directory:
77
----------
88
Found 0 warnings and 0 errors.
9-
Finished in <variable>ms on 0 files with 101 rules using 1 threads.
9+
Finished in <variable>ms on 0 files with 87 rules using 1 threads.
1010
----------
1111
CLI result: LintSucceeded
1212
----------

apps/oxlint/src/snapshots/_--import-plugin -A all -D no-cycle [email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ arguments: --import-plugin -A all -D no-cycle fixtures/flow/
66
working directory:
77
----------
88
Found 0 warnings and 0 errors.
9-
Finished in <variable>ms on 2 files with 103 rules using 1 threads.
9+
Finished in <variable>ms on 2 files with 89 rules using 1 threads.
1010
----------
1111
CLI result: LintSucceeded
1212
----------

apps/oxlint/src/snapshots/_--import-plugin [email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ arguments: --import-plugin fixtures/flow/index.mjs
66
working directory:
77
----------
88
Found 0 warnings and 0 errors.
9-
Finished in <variable>ms on 1 file with 103 rules using 1 threads.
9+
Finished in <variable>ms on 1 file with 89 rules using 1 threads.
1010
----------
1111
CLI result: LintSucceeded
1212
----------

apps/oxlint/src/snapshots/_--vitest-plugin -c fixtures__eslintrc_vitest_replace__eslintrc.json [email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ working directory:
2323
help: Remove the appending `.skip`
2424
2525
Found 1 warning and 1 error.
26-
Finished in <variable>ms on 1 file with 113 rules using 1 threads.
26+
Finished in <variable>ms on 1 file with 99 rules using 1 threads.
2727
----------
2828
CLI result: LintFoundErrors
2929
----------

apps/oxlint/src/snapshots/_-A all [email protected]

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ working directory:
77
----------
88
{
99
"plugins": [
10-
"react",
1110
"unicorn",
1211
"typescript",
1312
"oxc"

apps/oxlint/src/snapshots/_-D correctness [email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ working directory:
1414
help: Remove the debugger statement
1515
1616
Found 0 warnings and 1 error.
17-
Finished in <variable>ms on 1 file with 101 rules using 1 threads.
17+
Finished in <variable>ms on 1 file with 87 rules using 1 threads.
1818
----------
1919
CLI result: LintFoundErrors
2020
----------

apps/oxlint/src/snapshots/_-W correctness -A no-debugger [email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ arguments: -W correctness -A no-debugger fixtures/linter/debugger.js
66
working directory:
77
----------
88
Found 0 warnings and 0 errors.
9-
Finished in <variable>ms on 1 file with 100 rules using 1 threads.
9+
Finished in <variable>ms on 1 file with 86 rules using 1 threads.
1010
----------
1111
CLI result: LintSucceeded
1212
----------

apps/oxlint/src/snapshots/_-W no-undef -c fixtures__eslintrc_env__eslintrc_no_env.json [email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ working directory:
1313
`----
1414
1515
Found 1 warning and 0 errors.
16-
Finished in <variable>ms on 1 file with 102 rules using 1 threads.
16+
Finished in <variable>ms on 1 file with 88 rules using 1 threads.
1717
----------
1818
CLI result: LintSucceeded
1919
----------

apps/oxlint/src/snapshots/_-W no-undef -c fixtures__no_undef__eslintrc.json [email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ working directory:
1313
`----
1414
1515
Found 1 warning and 0 errors.
16-
Finished in <variable>ms on 1 file with 102 rules using 1 threads.
16+
Finished in <variable>ms on 1 file with 88 rules using 1 threads.
1717
----------
1818
CLI result: LintSucceeded
1919
----------

0 commit comments

Comments
 (0)