diff --git a/apps/oxlint/src/snapshots/_--ignore-path fixtures__linter__.customignore --no-ignore fixtures__linter__nan.js@oxlint.snap b/apps/oxlint/src/snapshots/_--ignore-path fixtures__linter__.customignore --no-ignore fixtures__linter__nan.js@oxlint.snap index 7721f36078f12..793153d1c29ba 100644 --- a/apps/oxlint/src/snapshots/_--ignore-path fixtures__linter__.customignore --no-ignore fixtures__linter__nan.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/_--ignore-path fixtures__linter__.customignore --no-ignore fixtures__linter__nan.js@oxlint.snap @@ -14,7 +14,7 @@ working directory: help: Use the isNaN function to compare with NaN. Found 1 warning and 0 errors. -Finished in ms on 1 file with 99 rules using 1 threads. +Finished in ms on 1 file with 100 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/_--ignore-pattern _____.js --ignore-pattern _____.vue fixtures__linter@oxlint.snap b/apps/oxlint/src/snapshots/_--ignore-pattern _____.js --ignore-pattern _____.vue fixtures__linter@oxlint.snap index 04b817f25309c..8ea072d42aa2d 100644 --- a/apps/oxlint/src/snapshots/_--ignore-pattern _____.js --ignore-pattern _____.vue fixtures__linter@oxlint.snap +++ b/apps/oxlint/src/snapshots/_--ignore-pattern _____.js --ignore-pattern _____.vue fixtures__linter@oxlint.snap @@ -6,7 +6,7 @@ arguments: --ignore-pattern **/*.js --ignore-pattern **/*.vue fixtures/linter working directory: ---------- Found 0 warnings and 0 errors. -Finished in ms on 0 files with 99 rules using 1 threads. +Finished in ms on 0 files with 100 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/_--import-plugin -A all -D no-cycle fixtures__flow__@oxlint.snap b/apps/oxlint/src/snapshots/_--import-plugin -A all -D no-cycle fixtures__flow__@oxlint.snap index 6183fcb7dd170..7e4f316c2326d 100644 --- a/apps/oxlint/src/snapshots/_--import-plugin -A all -D no-cycle fixtures__flow__@oxlint.snap +++ b/apps/oxlint/src/snapshots/_--import-plugin -A all -D no-cycle fixtures__flow__@oxlint.snap @@ -6,7 +6,7 @@ arguments: --import-plugin -A all -D no-cycle fixtures/flow/ working directory: ---------- Found 0 warnings and 0 errors. -Finished in ms on 2 files with 101 rules using 1 threads. +Finished in ms on 2 files with 102 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/_--import-plugin fixtures__flow__index.mjs@oxlint.snap b/apps/oxlint/src/snapshots/_--import-plugin fixtures__flow__index.mjs@oxlint.snap index 75aa4eebb7d41..811d383f709ad 100644 --- a/apps/oxlint/src/snapshots/_--import-plugin fixtures__flow__index.mjs@oxlint.snap +++ b/apps/oxlint/src/snapshots/_--import-plugin fixtures__flow__index.mjs@oxlint.snap @@ -6,7 +6,7 @@ arguments: --import-plugin fixtures/flow/index.mjs working directory: ---------- Found 0 warnings and 0 errors. -Finished in ms on 1 file with 101 rules using 1 threads. +Finished in ms on 1 file with 102 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/_--vitest-plugin -c fixtures__eslintrc_vitest_replace__eslintrc.json fixtures__eslintrc_vitest_replace__foo.test.js@oxlint.snap b/apps/oxlint/src/snapshots/_--vitest-plugin -c fixtures__eslintrc_vitest_replace__eslintrc.json fixtures__eslintrc_vitest_replace__foo.test.js@oxlint.snap index cfb742a24ce9a..67e7af76f2f71 100644 --- a/apps/oxlint/src/snapshots/_--vitest-plugin -c fixtures__eslintrc_vitest_replace__eslintrc.json fixtures__eslintrc_vitest_replace__foo.test.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/_--vitest-plugin -c fixtures__eslintrc_vitest_replace__eslintrc.json fixtures__eslintrc_vitest_replace__foo.test.js@oxlint.snap @@ -23,7 +23,7 @@ working directory: help: Remove the appending `.skip` Found 1 warning and 1 error. -Finished in ms on 1 file with 111 rules using 1 threads. +Finished in ms on 1 file with 112 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- diff --git a/apps/oxlint/src/snapshots/_-D correctness fixtures__linter__debugger.js@oxlint.snap b/apps/oxlint/src/snapshots/_-D correctness fixtures__linter__debugger.js@oxlint.snap index 30c938fe795b2..d05b2ea5d94f5 100644 --- a/apps/oxlint/src/snapshots/_-D correctness fixtures__linter__debugger.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/_-D correctness fixtures__linter__debugger.js@oxlint.snap @@ -14,7 +14,7 @@ working directory: help: Remove the debugger statement Found 0 warnings and 1 error. -Finished in ms on 1 file with 99 rules using 1 threads. +Finished in ms on 1 file with 100 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- diff --git a/apps/oxlint/src/snapshots/_-W correctness -A no-debugger fixtures__linter__debugger.js@oxlint.snap b/apps/oxlint/src/snapshots/_-W correctness -A no-debugger fixtures__linter__debugger.js@oxlint.snap index 11926e74336bd..4537edb45733b 100644 --- a/apps/oxlint/src/snapshots/_-W correctness -A no-debugger fixtures__linter__debugger.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/_-W correctness -A no-debugger fixtures__linter__debugger.js@oxlint.snap @@ -6,7 +6,7 @@ arguments: -W correctness -A no-debugger fixtures/linter/debugger.js working directory: ---------- Found 0 warnings and 0 errors. -Finished in ms on 1 file with 98 rules using 1 threads. +Finished in ms on 1 file with 99 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/_-W no-undef -c fixtures__eslintrc_env__eslintrc_no_env.json fixtures__eslintrc_env__test.js@oxlint.snap b/apps/oxlint/src/snapshots/_-W no-undef -c fixtures__eslintrc_env__eslintrc_no_env.json fixtures__eslintrc_env__test.js@oxlint.snap index 451e6f250263f..712a2dd9295f5 100644 --- a/apps/oxlint/src/snapshots/_-W no-undef -c fixtures__eslintrc_env__eslintrc_no_env.json fixtures__eslintrc_env__test.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/_-W no-undef -c fixtures__eslintrc_env__eslintrc_no_env.json fixtures__eslintrc_env__test.js@oxlint.snap @@ -13,7 +13,7 @@ working directory: `---- Found 1 warning and 0 errors. -Finished in ms on 1 file with 100 rules using 1 threads. +Finished in ms on 1 file with 101 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/_-W no-undef -c fixtures__no_undef__eslintrc.json fixtures__no_undef__test.js@oxlint.snap b/apps/oxlint/src/snapshots/_-W no-undef -c fixtures__no_undef__eslintrc.json fixtures__no_undef__test.js@oxlint.snap index b34f6ffdb16df..1cca05a40f550 100644 --- a/apps/oxlint/src/snapshots/_-W no-undef -c fixtures__no_undef__eslintrc.json fixtures__no_undef__test.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/_-W no-undef -c fixtures__no_undef__eslintrc.json fixtures__no_undef__test.js@oxlint.snap @@ -13,7 +13,7 @@ working directory: `---- Found 1 warning and 0 errors. -Finished in ms on 1 file with 100 rules using 1 threads. +Finished in ms on 1 file with 101 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/_-c fixtures__config_ignore_patterns__ignore_extension__eslintrc.json fixtures__config_ignore_patterns__ignore_extension@oxlint.snap b/apps/oxlint/src/snapshots/_-c fixtures__config_ignore_patterns__ignore_extension__eslintrc.json fixtures__config_ignore_patterns__ignore_extension@oxlint.snap index a43786a245a3e..8140a8404ab68 100644 --- a/apps/oxlint/src/snapshots/_-c fixtures__config_ignore_patterns__ignore_extension__eslintrc.json fixtures__config_ignore_patterns__ignore_extension@oxlint.snap +++ b/apps/oxlint/src/snapshots/_-c fixtures__config_ignore_patterns__ignore_extension__eslintrc.json fixtures__config_ignore_patterns__ignore_extension@oxlint.snap @@ -12,7 +12,7 @@ working directory: help: Delete this file or add some code to it. Found 1 warning and 0 errors. -Finished in ms on 1 file with 99 rules using 1 threads. +Finished in ms on 1 file with 100 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/_-c fixtures__eslintrc_env__eslintrc_env_browser.json fixtures__eslintrc_env__test.js@oxlint.snap b/apps/oxlint/src/snapshots/_-c fixtures__eslintrc_env__eslintrc_env_browser.json fixtures__eslintrc_env__test.js@oxlint.snap index cb33e86eda5d2..dce69c6b57347 100644 --- a/apps/oxlint/src/snapshots/_-c fixtures__eslintrc_env__eslintrc_env_browser.json fixtures__eslintrc_env__test.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/_-c fixtures__eslintrc_env__eslintrc_env_browser.json fixtures__eslintrc_env__test.js@oxlint.snap @@ -6,7 +6,7 @@ arguments: -c fixtures/eslintrc_env/eslintrc_env_browser.json fixtures/eslintrc_ working directory: ---------- Found 0 warnings and 0 errors. -Finished in ms on 1 file with 100 rules using 1 threads. +Finished in ms on 1 file with 101 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/_-c fixtures__eslintrc_off__eslintrc.json fixtures__eslintrc_off__test.js@oxlint.snap b/apps/oxlint/src/snapshots/_-c fixtures__eslintrc_off__eslintrc.json fixtures__eslintrc_off__test.js@oxlint.snap index 49f293a3120bc..1882960fa4ff7 100644 --- a/apps/oxlint/src/snapshots/_-c fixtures__eslintrc_off__eslintrc.json fixtures__eslintrc_off__test.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/_-c fixtures__eslintrc_off__eslintrc.json fixtures__eslintrc_off__test.js@oxlint.snap @@ -12,7 +12,7 @@ working directory: help: Delete this file or add some code to it. Found 1 warning and 0 errors. -Finished in ms on 1 file with 99 rules using 1 threads. +Finished in ms on 1 file with 100 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/_-c fixtures__eslintrc_vitest_replace__eslintrc.json fixtures__eslintrc_vitest_replace__foo.test.js@oxlint.snap b/apps/oxlint/src/snapshots/_-c fixtures__eslintrc_vitest_replace__eslintrc.json fixtures__eslintrc_vitest_replace__foo.test.js@oxlint.snap index 77f21d13514f5..be8c10c9b0c28 100644 --- a/apps/oxlint/src/snapshots/_-c fixtures__eslintrc_vitest_replace__eslintrc.json fixtures__eslintrc_vitest_replace__foo.test.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/_-c fixtures__eslintrc_vitest_replace__eslintrc.json fixtures__eslintrc_vitest_replace__foo.test.js@oxlint.snap @@ -6,7 +6,7 @@ arguments: -c fixtures/eslintrc_vitest_replace/eslintrc.json fixtures/eslintrc_v working directory: ---------- Found 0 warnings and 0 errors. -Finished in ms on 1 file with 99 rules using 1 threads. +Finished in ms on 1 file with 100 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/_-c fixtures__linter__eslintrc.json fixtures__linter__debugger.js@oxlint.snap b/apps/oxlint/src/snapshots/_-c fixtures__linter__eslintrc.json fixtures__linter__debugger.js@oxlint.snap index 7b295213d7c2e..1304b6b930ec1 100644 --- a/apps/oxlint/src/snapshots/_-c fixtures__linter__eslintrc.json fixtures__linter__debugger.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/_-c fixtures__linter__eslintrc.json fixtures__linter__debugger.js@oxlint.snap @@ -14,7 +14,7 @@ working directory: help: Remove the debugger statement Found 0 warnings and 1 error. -Finished in ms on 1 file with 99 rules using 1 threads. +Finished in ms on 1 file with 100 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- diff --git a/apps/oxlint/src/snapshots/_-c fixtures__no_console_off__eslintrc.json fixtures__no_console_off__test.js@oxlint.snap b/apps/oxlint/src/snapshots/_-c fixtures__no_console_off__eslintrc.json fixtures__no_console_off__test.js@oxlint.snap index 382c554509c03..4e4b1a536da0e 100644 --- a/apps/oxlint/src/snapshots/_-c fixtures__no_console_off__eslintrc.json fixtures__no_console_off__test.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/_-c fixtures__no_console_off__eslintrc.json fixtures__no_console_off__test.js@oxlint.snap @@ -6,7 +6,7 @@ arguments: -c fixtures/no_console_off/eslintrc.json fixtures/no_console_off/test working directory: ---------- Found 0 warnings and 0 errors. -Finished in ms on 1 file with 99 rules using 1 threads. +Finished in ms on 1 file with 100 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/_-c fixtures__no_empty_allow_empty_catch__eslintrc.json -W no-empty fixtures__no_empty_allow_empty_catch__test.js@oxlint.snap b/apps/oxlint/src/snapshots/_-c fixtures__no_empty_allow_empty_catch__eslintrc.json -W no-empty fixtures__no_empty_allow_empty_catch__test.js@oxlint.snap index a3f53acca7df7..3ffc946d29825 100644 --- a/apps/oxlint/src/snapshots/_-c fixtures__no_empty_allow_empty_catch__eslintrc.json -W no-empty fixtures__no_empty_allow_empty_catch__test.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/_-c fixtures__no_empty_allow_empty_catch__eslintrc.json -W no-empty fixtures__no_empty_allow_empty_catch__test.js@oxlint.snap @@ -6,7 +6,7 @@ arguments: -c fixtures/no_empty_allow_empty_catch/eslintrc.json -W no-empty fixt working directory: ---------- Found 0 warnings and 0 errors. -Finished in ms on 1 file with 100 rules using 1 threads. +Finished in ms on 1 file with 101 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/_-c fixtures__no_empty_disallow_empty_catch__eslintrc.json -W no-empty fixtures__no_empty_disallow_empty_catch__test.js@oxlint.snap b/apps/oxlint/src/snapshots/_-c fixtures__no_empty_disallow_empty_catch__eslintrc.json -W no-empty fixtures__no_empty_disallow_empty_catch__test.js@oxlint.snap index 95a340ff42192..b5beddcc6e2ae 100644 --- a/apps/oxlint/src/snapshots/_-c fixtures__no_empty_disallow_empty_catch__eslintrc.json -W no-empty fixtures__no_empty_disallow_empty_catch__test.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/_-c fixtures__no_empty_disallow_empty_catch__eslintrc.json -W no-empty fixtures__no_empty_disallow_empty_catch__test.js@oxlint.snap @@ -14,7 +14,7 @@ working directory: help: Remove this block or add a comment inside it Found 1 warning and 0 errors. -Finished in ms on 1 file with 100 rules using 1 threads. +Finished in ms on 1 file with 101 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/_-c fixtures__overrides__.oxlintrc.json fixtures__overrides__test.js -c fixtures__overrides__.oxlintrc.json fixtures__overrides__test.ts -c fixtures__overrides__.oxlintrc.json fixtures__overrides__other.jsx@oxlint.snap b/apps/oxlint/src/snapshots/_-c fixtures__overrides__.oxlintrc.json fixtures__overrides__test.js -c fixtures__overrides__.oxlintrc.json fixtures__overrides__test.ts -c fixtures__overrides__.oxlintrc.json fixtures__overrides__other.jsx@oxlint.snap index a03d8b7ba3ebf..6aecdc8f28e8f 100644 --- a/apps/oxlint/src/snapshots/_-c fixtures__overrides__.oxlintrc.json fixtures__overrides__test.js -c fixtures__overrides__.oxlintrc.json fixtures__overrides__test.ts -c fixtures__overrides__.oxlintrc.json fixtures__overrides__other.jsx@oxlint.snap +++ b/apps/oxlint/src/snapshots/_-c fixtures__overrides__.oxlintrc.json fixtures__overrides__test.js -c fixtures__overrides__.oxlintrc.json fixtures__overrides__test.ts -c fixtures__overrides__.oxlintrc.json fixtures__overrides__other.jsx@oxlint.snap @@ -15,7 +15,7 @@ working directory: help: Replace var with let or const Found 0 warnings and 1 error. -Finished in ms on 1 file with 101 rules using 1 threads. +Finished in ms on 1 file with 102 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- @@ -42,7 +42,7 @@ working directory: help: Delete this console statement. Found 1 warning and 1 error. -Finished in ms on 1 file with 101 rules using 1 threads. +Finished in ms on 1 file with 102 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- @@ -61,7 +61,7 @@ working directory: help: Replace var with let or const Found 0 warnings and 1 error. -Finished in ms on 1 file with 101 rules using 1 threads. +Finished in ms on 1 file with 102 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- diff --git a/apps/oxlint/src/snapshots/_-c fixtures__overrides__directories-config.json fixtures__overrides@oxlint.snap b/apps/oxlint/src/snapshots/_-c fixtures__overrides__directories-config.json fixtures__overrides@oxlint.snap index 48176580cad31..0f0c93a8c659c 100644 --- a/apps/oxlint/src/snapshots/_-c fixtures__overrides__directories-config.json fixtures__overrides@oxlint.snap +++ b/apps/oxlint/src/snapshots/_-c fixtures__overrides__directories-config.json fixtures__overrides@oxlint.snap @@ -35,7 +35,7 @@ working directory: help: Remove the debugger statement Found 2 warnings and 2 errors. -Finished in ms on 7 files with 98 rules using 1 threads. +Finished in ms on 7 files with 99 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- diff --git a/apps/oxlint/src/snapshots/_fixtures__astro__debugger.astro@oxlint.snap b/apps/oxlint/src/snapshots/_fixtures__astro__debugger.astro@oxlint.snap index 7e1fcbfe61929..8d858645658dd 100644 --- a/apps/oxlint/src/snapshots/_fixtures__astro__debugger.astro@oxlint.snap +++ b/apps/oxlint/src/snapshots/_fixtures__astro__debugger.astro@oxlint.snap @@ -43,7 +43,7 @@ working directory: help: Remove the debugger statement Found 4 warnings and 0 errors. -Finished in ms on 1 file with 99 rules using 1 threads. +Finished in ms on 1 file with 100 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/_fixtures__linter@oxlint.snap b/apps/oxlint/src/snapshots/_fixtures__linter@oxlint.snap index e42070e8d2e84..6df9830a0a872 100644 --- a/apps/oxlint/src/snapshots/_fixtures__linter@oxlint.snap +++ b/apps/oxlint/src/snapshots/_fixtures__linter@oxlint.snap @@ -28,7 +28,7 @@ working directory: help: Use the isNaN function to compare with NaN. Found 3 warnings and 0 errors. -Finished in ms on 3 files with 99 rules using 1 threads. +Finished in ms on 3 files with 100 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/_fixtures__linter__debugger.js fixtures__linter__nan.js@oxlint.snap b/apps/oxlint/src/snapshots/_fixtures__linter__debugger.js fixtures__linter__nan.js@oxlint.snap index 1504b43a34c32..d5fc508fb4738 100644 --- a/apps/oxlint/src/snapshots/_fixtures__linter__debugger.js fixtures__linter__nan.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/_fixtures__linter__debugger.js fixtures__linter__nan.js@oxlint.snap @@ -21,7 +21,7 @@ working directory: help: Use the isNaN function to compare with NaN. Found 2 warnings and 0 errors. -Finished in ms on 2 files with 99 rules using 1 threads. +Finished in ms on 2 files with 100 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/_fixtures__linter__debugger.js@oxlint.snap b/apps/oxlint/src/snapshots/_fixtures__linter__debugger.js@oxlint.snap index 55266560f3773..b86a54498151d 100644 --- a/apps/oxlint/src/snapshots/_fixtures__linter__debugger.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/_fixtures__linter__debugger.js@oxlint.snap @@ -14,7 +14,7 @@ working directory: help: Remove the debugger statement Found 1 warning and 0 errors. -Finished in ms on 1 file with 99 rules using 1 threads. +Finished in ms on 1 file with 100 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/_fixtures__svelte__debugger.svelte@oxlint.snap b/apps/oxlint/src/snapshots/_fixtures__svelte__debugger.svelte@oxlint.snap index a1a80722f9091..56ff4d8cc9aaa 100644 --- a/apps/oxlint/src/snapshots/_fixtures__svelte__debugger.svelte@oxlint.snap +++ b/apps/oxlint/src/snapshots/_fixtures__svelte__debugger.svelte@oxlint.snap @@ -16,7 +16,7 @@ working directory: help: Remove the debugger statement Found 1 warning and 0 errors. -Finished in ms on 1 file with 99 rules using 1 threads. +Finished in ms on 1 file with 100 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/_fixtures__vue__debugger.vue@oxlint.snap b/apps/oxlint/src/snapshots/_fixtures__vue__debugger.vue@oxlint.snap index 131c064030a33..452290611ceed 100644 --- a/apps/oxlint/src/snapshots/_fixtures__vue__debugger.vue@oxlint.snap +++ b/apps/oxlint/src/snapshots/_fixtures__vue__debugger.vue@oxlint.snap @@ -25,7 +25,7 @@ working directory: help: Remove the debugger statement Found 2 warnings and 0 errors. -Finished in ms on 1 file with 99 rules using 1 threads. +Finished in ms on 1 file with 100 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/_fixtures__vue__empty.vue@oxlint.snap b/apps/oxlint/src/snapshots/_fixtures__vue__empty.vue@oxlint.snap index fe00a080bda4e..cd0e5c08094d9 100644 --- a/apps/oxlint/src/snapshots/_fixtures__vue__empty.vue@oxlint.snap +++ b/apps/oxlint/src/snapshots/_fixtures__vue__empty.vue@oxlint.snap @@ -6,7 +6,7 @@ arguments: fixtures/vue/empty.vue working directory: ---------- Found 0 warnings and 0 errors. -Finished in ms on 1 file with 99 rules using 1 threads. +Finished in ms on 1 file with 100 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/_foo.asdf@oxlint.snap b/apps/oxlint/src/snapshots/_foo.asdf@oxlint.snap index 4039b37dc6e05..87d399e398cd6 100644 --- a/apps/oxlint/src/snapshots/_foo.asdf@oxlint.snap +++ b/apps/oxlint/src/snapshots/_foo.asdf@oxlint.snap @@ -6,7 +6,7 @@ arguments: foo.asdf working directory: ---------- Found 0 warnings and 0 errors. -Finished in ms on 0 files with 99 rules using 1 threads. +Finished in ms on 0 files with 100 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__config_ignore_patterns__ignore_directory_-c eslintrc.json@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__config_ignore_patterns__ignore_directory_-c eslintrc.json@oxlint.snap index c1448f6e7518a..4ffcea39f4c1a 100644 --- a/apps/oxlint/src/snapshots/fixtures__config_ignore_patterns__ignore_directory_-c eslintrc.json@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__config_ignore_patterns__ignore_directory_-c eslintrc.json@oxlint.snap @@ -14,7 +14,7 @@ working directory: fixtures/config_ignore_patterns/ignore_directory help: Delete this file or add some code to it. Found 1 warning and 0 errors. -Finished in ms on 1 file with 99 rules using 1 threads. +Finished in ms on 1 file with 100 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__config_ignore_patterns__with_oxlintrc_-c .__test__eslintrc.json --ignore-pattern _.ts .@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__config_ignore_patterns__with_oxlintrc_-c .__test__eslintrc.json --ignore-pattern _.ts .@oxlint.snap index 874ec0f5979e3..3b73dab0a2caf 100644 --- a/apps/oxlint/src/snapshots/fixtures__config_ignore_patterns__with_oxlintrc_-c .__test__eslintrc.json --ignore-pattern _.ts .@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__config_ignore_patterns__with_oxlintrc_-c .__test__eslintrc.json --ignore-pattern _.ts .@oxlint.snap @@ -12,7 +12,7 @@ working directory: fixtures/config_ignore_patterns/with_oxlintrc help: Delete this file or add some code to it. Found 1 warning and 0 errors. -Finished in ms on 1 file with 99 rules using 1 threads. +Finished in ms on 1 file with 100 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__extends_config_--config extends_rules_config.json console.js@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__extends_config_--config extends_rules_config.json console.js@oxlint.snap index a38375fd84b45..9b9e35119c848 100644 --- a/apps/oxlint/src/snapshots/fixtures__extends_config_--config extends_rules_config.json console.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__extends_config_--config extends_rules_config.json console.js@oxlint.snap @@ -14,7 +14,7 @@ working directory: fixtures/extends_config help: Delete this console statement. Found 0 warnings and 1 error. -Finished in ms on 1 file with 100 rules using 1 threads. +Finished in ms on 1 file with 101 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__extends_config_--config relative_paths__extends_extends_config.json console.js@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__extends_config_--config relative_paths__extends_extends_config.json console.js@oxlint.snap index 089ad5cb2ae8f..4caff171f72c2 100644 --- a/apps/oxlint/src/snapshots/fixtures__extends_config_--config relative_paths__extends_extends_config.json console.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__extends_config_--config relative_paths__extends_extends_config.json console.js@oxlint.snap @@ -14,7 +14,7 @@ working directory: fixtures/extends_config help: Delete this console statement. Found 0 warnings and 1 error. -Finished in ms on 1 file with 101 rules using 1 threads. +Finished in ms on 1 file with 102 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__extends_config_--disable-nested-config@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__extends_config_--disable-nested-config@oxlint.snap index 237fcda1c817f..a2715882d9592 100644 --- a/apps/oxlint/src/snapshots/fixtures__extends_config_--disable-nested-config@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__extends_config_--disable-nested-config@oxlint.snap @@ -31,7 +31,7 @@ working directory: fixtures/extends_config help: Remove the debugger statement Found 3 warnings and 0 errors. -Finished in ms on 4 files with 99 rules using 1 threads. +Finished in ms on 4 files with 100 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__ignore_file_current_dir_ .@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__ignore_file_current_dir_ .@oxlint.snap index aa5a8e28b36d8..7d27b0ad31566 100644 --- a/apps/oxlint/src/snapshots/fixtures__ignore_file_current_dir_ .@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__ignore_file_current_dir_ .@oxlint.snap @@ -6,7 +6,7 @@ arguments: working directory: fixtures/ignore_file_current_dir ---------- Found 0 warnings and 0 errors. -Finished in ms on 0 files with 99 rules using 1 threads. +Finished in ms on 0 files with 100 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- @@ -16,7 +16,7 @@ arguments: . working directory: fixtures/ignore_file_current_dir ---------- Found 0 warnings and 0 errors. -Finished in ms on 0 files with 99 rules using 1 threads. +Finished in ms on 0 files with 100 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__import-cycle_--import-plugin -D import__no-cycle@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__import-cycle_--import-plugin -D import__no-cycle@oxlint.snap index a71c3d0ac79d2..c29dfa1bdff2a 100644 --- a/apps/oxlint/src/snapshots/fixtures__import-cycle_--import-plugin -D import__no-cycle@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__import-cycle_--import-plugin -D import__no-cycle@oxlint.snap @@ -27,7 +27,7 @@ working directory: fixtures/import-cycle -> ./b - fixtures/import-cycle/b.ts Found 0 warnings and 2 errors. -Finished in ms on 2 files with 102 rules using 1 threads. +Finished in ms on 2 files with 103 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__linter_debugger.js@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__linter_debugger.js@oxlint.snap index 5133e2c69fb19..36e0176fd21e8 100644 --- a/apps/oxlint/src/snapshots/fixtures__linter_debugger.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__linter_debugger.js@oxlint.snap @@ -14,7 +14,7 @@ working directory: fixtures/linter help: Remove the debugger statement Found 1 warning and 0 errors. -Finished in ms on 1 file with 99 rules using 1 threads. +Finished in ms on 1 file with 100 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__nested_config_--config oxlint-no-console.json@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__nested_config_--config oxlint-no-console.json@oxlint.snap index 2b1ba527aeb5b..d14d0b2d0a52a 100644 --- a/apps/oxlint/src/snapshots/fixtures__nested_config_--config oxlint-no-console.json@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__nested_config_--config oxlint-no-console.json@oxlint.snap @@ -37,7 +37,7 @@ working directory: fixtures/nested_config help: Delete this console statement. Found 0 warnings and 4 errors. -Finished in ms on 7 files with 99 rules using 1 threads. +Finished in ms on 7 files with 100 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__nested_config_-A no-console --config oxlint-no-console.json@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__nested_config_-A no-console --config oxlint-no-console.json@oxlint.snap index 7e174ba6c9fa9..55b915af88d5c 100644 --- a/apps/oxlint/src/snapshots/fixtures__nested_config_-A no-console --config oxlint-no-console.json@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__nested_config_-A no-console --config oxlint-no-console.json@oxlint.snap @@ -6,7 +6,7 @@ arguments: -A no-console --config oxlint-no-console.json working directory: fixtures/nested_config ---------- Found 0 warnings and 0 errors. -Finished in ms on 7 files with 98 rules using 1 threads. +Finished in ms on 7 files with 99 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__overrides_env_globals_-c .oxlintrc.json .@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__overrides_env_globals_-c .oxlintrc.json .@oxlint.snap index c69431376ae32..77a289ffcc590 100644 --- a/apps/oxlint/src/snapshots/fixtures__overrides_env_globals_-c .oxlintrc.json .@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__overrides_env_globals_-c .oxlintrc.json .@oxlint.snap @@ -51,7 +51,7 @@ working directory: fixtures/overrides_env_globals `---- Found 5 warnings and 0 errors. -Finished in ms on 3 files with 99 rules using 1 threads. +Finished in ms on 3 files with 100 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__report_unused_directives_-c .oxlintrc.json --report-unused-disable-directives test.js@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__report_unused_directives_-c .oxlintrc.json --report-unused-disable-directives test.js@oxlint.snap index d9c6f374212e6..a0520c3aa5cc7 100644 --- a/apps/oxlint/src/snapshots/fixtures__report_unused_directives_-c .oxlintrc.json --report-unused-disable-directives test.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__report_unused_directives_-c .oxlintrc.json --report-unused-disable-directives test.js@oxlint.snap @@ -39,7 +39,7 @@ working directory: fixtures/report_unused_directives `---- Found 4 warnings and 0 errors. -Finished in ms on 1 file with 100 rules using 1 threads. +Finished in ms on 1 file with 101 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/crates/oxc_linter/src/rules.rs b/crates/oxc_linter/src/rules.rs index 88922b945000a..1dec81ad55777 100644 --- a/crates/oxc_linter/src/rules.rs +++ b/crates/oxc_linter/src/rules.rs @@ -282,6 +282,7 @@ mod react { pub mod button_has_type; pub mod checked_requires_onchange_or_readonly; pub mod exhaustive_deps; + pub mod forward_ref_uses_ref; pub mod iframe_missing_sandbox; pub mod jsx_boolean_value; pub mod jsx_curly_brace_presence; @@ -885,6 +886,7 @@ oxc_macros::declare_all_lint_rules! { react::button_has_type, react::checked_requires_onchange_or_readonly, react::exhaustive_deps, + react::forward_ref_uses_ref, react::iframe_missing_sandbox, react::jsx_filename_extension, react::jsx_boolean_value, diff --git a/crates/oxc_linter/src/rules/react/forward_ref_uses_ref.rs b/crates/oxc_linter/src/rules/react/forward_ref_uses_ref.rs new file mode 100644 index 0000000000000..70a2e226a1ca2 --- /dev/null +++ b/crates/oxc_linter/src/rules/react/forward_ref_uses_ref.rs @@ -0,0 +1,207 @@ +use crate::{ContextHost, FrameworkFlags}; +use oxc_ast::{AstKind, ast::Expression}; +use oxc_diagnostics::OxcDiagnostic; +use oxc_macros::declare_oxc_lint; +use oxc_span::Span; + +use crate::{AstNode, context::LintContext, rule::Rule}; + +fn forward_ref_uses_ref_diagnostic(span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Components wrapped with `forwardRef` must have a `ref` parameter") + .with_help("Add a `ref` parameter, or remove `forwardRef`") + .with_label(span) +} + +#[derive(Debug, Default, Clone)] +pub struct ForwardRefUsesRef; + +declare_oxc_lint!( + /// ### What it does + /// + /// Requires that components wrapped with `forwardRef` must have a `ref` parameter. + /// Omitting the `ref` argument is usually a bug, + /// and components not using `ref` don't need to be wrapped by `forwardRef`. + /// + /// ### Why is this bad? + /// + /// Omitting the `ref` argument makes the `forwardRef` wrapper unnecessary, + /// and can lead to confusion. + /// + /// ### Examples + /// + /// Examples of **incorrect** code for this rule: + /// ```jsx + /// var React = require('react'); + /// + /// var Component = React.forwardRef((props) => ( + ///
+ /// )); + /// ``` + /// + /// Examples of **correct** code for this rule: + /// ```jsx + /// var React = require('react'); + /// + /// var Component = React.forwardRef((props, ref) => ( + ///
+ /// )); + /// + /// var Component = React.forwardRef((props, ref) => ( + ///
+ /// )); + /// + /// function Component(props) { + /// return
; + /// }; + /// ``` + ForwardRefUsesRef, + react, + correctness, + pending + // TODO: two ways to fix it: add `ref` param or remove `forwardRef` call +); + +fn check_forward_ref_inner(exp: &Expression, ctx: &LintContext) { + match exp { + Expression::ArrowFunctionExpression(f) => { + if f.params.parameters_count() >= 2 || f.params.rest.is_some() { + return; + } + ctx.diagnostic(forward_ref_uses_ref_diagnostic(f.span)); + } + Expression::FunctionExpression(f) => { + if f.params.parameters_count() >= 2 || f.params.rest.is_some() { + return; + } + ctx.diagnostic(forward_ref_uses_ref_diagnostic(f.span)); + } + // NOTE: Not sure whether to warn in `forwardRef(((props, ref) => null))` (with parentheses) + // Expression::ParenthesizedExpression(p) => check_forward_ref_inner(&p.expression), + _ => {} + } +} + +impl Rule for ForwardRefUsesRef { + fn run<'a>(&self, node: &AstNode<'a>, ctx: &LintContext<'a>) { + let AstKind::CallExpression(call_expr) = node.kind() else { + return; + }; + + let Some("forwardRef") = call_expr.callee_name() else { + return; + }; + let Some(first_arg) = call_expr.arguments.first() else { + return; + }; + let Some(first_arg_as_exp) = first_arg.as_expression() else { + return; // SpreadElement like forwardRef(...x) + }; + + check_forward_ref_inner(first_arg_as_exp, ctx); + } + + fn should_run(&self, ctx: &ContextHost) -> bool { + ctx.frameworks().contains(FrameworkFlags::React) + } +} + +#[test] +fn test() { + use crate::LintOptions; + use crate::tester::Tester; + + let pass = vec![ + " + import { forwardRef } from 'react' + forwardRef((props, ref) => { + return null; + }); + ", + " + import { forwardRef } from 'react' + forwardRef((props, ref) => null); + ", + " + import { forwardRef } from 'react' + forwardRef(function (props, ref) { + return null; + }); + ", + " + import { forwardRef } from 'react' + forwardRef(function Component(props, ref) { + return null; + }); + ", + " + import * as React from 'react' + React.forwardRef((props, ref) => { + return null; + }); + ", + " + import * as React from 'react' + React.forwardRef((props, ref) => null); + ", + " + import * as React from 'react' + React.forwardRef(function (props, ref) { + return null; + }); + ", + " + import * as React from 'react' + React.forwardRef(function Component(props, ref) { + return null; + }); + ", + " + import * as React from 'react' + function Component(props) { + return null; + }; + ", + " + import * as React from 'react' + (props) => null; + ", + ]; + + let fail = vec![ + " + import { forwardRef } from 'react' + forwardRef((props) => { + return null; + }); + ", + " + import { forwardRef } from 'react' + forwardRef(props => { + return null; + }); + ", + " + import * as React from 'react' + React.forwardRef((props) => null); + ", + " + import { forwardRef } from 'react' + const Component = forwardRef(function (props) { + return null; + }); + ", + " + import * as React from 'react' + React.forwardRef(function Component(props) { + return null; + }); + ", + ]; + + Tester::new(ForwardRefUsesRef::NAME, ForwardRefUsesRef::PLUGIN, pass, fail) + .with_lint_options(LintOptions { + framework_hints: FrameworkFlags::React, + ..LintOptions::default() + }) + .test_and_snapshot(); +} diff --git a/crates/oxc_linter/src/snapshots/react_forward_ref_uses_ref.snap b/crates/oxc_linter/src/snapshots/react_forward_ref_uses_ref.snap new file mode 100644 index 0000000000000..cf24e5529152b --- /dev/null +++ b/crates/oxc_linter/src/snapshots/react_forward_ref_uses_ref.snap @@ -0,0 +1,51 @@ +--- +source: crates/oxc_linter/src/tester.rs +--- + ⚠ eslint-plugin-react(forward-ref-uses-ref): Components wrapped with `forwardRef` must have a `ref` parameter + ╭─[forward_ref_uses_ref.tsx:3:23] + 2 │ import { forwardRef } from 'react' + 3 │ ╭─▶ forwardRef((props) => { + 4 │ │ return null; + 5 │ ╰─▶ }); + 6 │ + ╰──── + help: Add a `ref` parameter, or remove `forwardRef` + + ⚠ eslint-plugin-react(forward-ref-uses-ref): Components wrapped with `forwardRef` must have a `ref` parameter + ╭─[forward_ref_uses_ref.tsx:3:23] + 2 │ import { forwardRef } from 'react' + 3 │ ╭─▶ forwardRef(props => { + 4 │ │ return null; + 5 │ ╰─▶ }); + 6 │ + ╰──── + help: Add a `ref` parameter, or remove `forwardRef` + + ⚠ eslint-plugin-react(forward-ref-uses-ref): Components wrapped with `forwardRef` must have a `ref` parameter + ╭─[forward_ref_uses_ref.tsx:3:29] + 2 │ import * as React from 'react' + 3 │ React.forwardRef((props) => null); + · ─────────────── + 4 │ + ╰──── + help: Add a `ref` parameter, or remove `forwardRef` + + ⚠ eslint-plugin-react(forward-ref-uses-ref): Components wrapped with `forwardRef` must have a `ref` parameter + ╭─[forward_ref_uses_ref.tsx:3:41] + 2 │ import { forwardRef } from 'react' + 3 │ ╭─▶ const Component = forwardRef(function (props) { + 4 │ │ return null; + 5 │ ╰─▶ }); + 6 │ + ╰──── + help: Add a `ref` parameter, or remove `forwardRef` + + ⚠ eslint-plugin-react(forward-ref-uses-ref): Components wrapped with `forwardRef` must have a `ref` parameter + ╭─[forward_ref_uses_ref.tsx:3:29] + 2 │ import * as React from 'react' + 3 │ ╭─▶ React.forwardRef(function Component(props) { + 4 │ │ return null; + 5 │ ╰─▶ }); + 6 │ + ╰──── + help: Add a `ref` parameter, or remove `forwardRef`