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__disable_eslint_and_unicorn_alias_rules_-c .oxlintrc-eslint.json test.js -c .oxlintrc-unicorn.json test.js@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__disable_eslint_and_unicorn_alias_rules_-c .oxlintrc-eslint.json test.js -c .oxlintrc-unicorn.json test.js@oxlint.snap index f344b0ecb8b36..5b1b01aa13fc5 100644 --- a/apps/oxlint/src/snapshots/fixtures__disable_eslint_and_unicorn_alias_rules_-c .oxlintrc-eslint.json test.js -c .oxlintrc-unicorn.json test.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__disable_eslint_and_unicorn_alias_rules_-c .oxlintrc-eslint.json test.js -c .oxlintrc-unicorn.json test.js@oxlint.snap @@ -16,7 +16,7 @@ arguments: -c .oxlintrc-unicorn.json test.js working directory: fixtures/disable_eslint_and_unicorn_alias_rules ---------- Found 0 warnings and 0 errors. -Finished in ms on 1 file with 62 rules using 1 threads. +Finished in ms on 1 file with 63 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/apps/oxlint/src/snapshots/fixtures__two_rules_with_same_rule_name_-c .oxlintrc.json test.js@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__two_rules_with_same_rule_name_-c .oxlintrc.json test.js@oxlint.snap index 344d577bfc5f4..b031565413ec8 100644 --- a/apps/oxlint/src/snapshots/fixtures__two_rules_with_same_rule_name_-c .oxlintrc.json test.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__two_rules_with_same_rule_name_-c .oxlintrc.json test.js@oxlint.snap @@ -6,7 +6,7 @@ arguments: -c .oxlintrc.json test.js working directory: fixtures/two_rules_with_same_rule_name ---------- Found 0 warnings and 0 errors. -Finished in ms on 1 file with 62 rules using 1 threads. +Finished in ms on 1 file with 63 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/crates/oxc_linter/src/rules.rs b/crates/oxc_linter/src/rules.rs index 9d54f7a3e83eb..88922b945000a 100644 --- a/crates/oxc_linter/src/rules.rs +++ b/crates/oxc_linter/src/rules.rs @@ -325,6 +325,7 @@ mod react_perf { mod unicorn { pub mod catch_error_name; + pub mod consistent_assert; pub mod consistent_date_clone; pub mod consistent_empty_array_spread; pub mod consistent_existence_index_check; @@ -963,6 +964,7 @@ oxc_macros::declare_all_lint_rules! { typescript::prefer_ts_expect_error, typescript::triple_slash_reference, unicorn::catch_error_name, + unicorn::consistent_assert, unicorn::consistent_date_clone, unicorn::consistent_empty_array_spread, unicorn::consistent_existence_index_check, diff --git a/crates/oxc_linter/src/rules/unicorn/consistent_assert.rs b/crates/oxc_linter/src/rules/unicorn/consistent_assert.rs new file mode 100644 index 0000000000000..5ff0f7a24cdb6 --- /dev/null +++ b/crates/oxc_linter/src/rules/unicorn/consistent_assert.rs @@ -0,0 +1,321 @@ +use oxc_ast::{ + AstKind, + ast::{Expression, ImportDeclaration, ImportDeclarationSpecifier}, +}; +use oxc_diagnostics::OxcDiagnostic; +use oxc_macros::declare_oxc_lint; +use oxc_semantic::SymbolId; +use oxc_span::Span; + +use crate::{AstNode, context::LintContext, rule::Rule}; + +fn consistent_assert_diagnostic(assert_identifier: &str, span: Span) -> OxcDiagnostic { + OxcDiagnostic::warn("Inconsistent assert usage") + .with_help(format!("Prefer {assert_identifier}.ok(...) over {assert_identifier}(...)")) + .with_label(span) +} + +#[derive(Debug, Default, Clone)] +pub struct ConsistentAssert; + +declare_oxc_lint!( + /// ### What it does + /// + /// Enforces consistent usage of the `assert` module. + /// + /// ### Why is this bad? + /// + /// Inconsistent usage of the `assert` module can lead to confusion and errors. + /// + /// ### Examples + /// + /// Examples of **incorrect** code for this rule: + /// ```js + /// import assert from 'node:assert'; + /// + /// assert(divide(10, 2) === 5); + /// ``` + /// + /// Examples of **correct** code for this rule: + /// ```js + /// import assert from 'node:assert'; + /// + /// assert.ok(divide(10, 2) === 5); + /// ``` + ConsistentAssert, + unicorn, + correctness, + fix, +); + +impl Rule for ConsistentAssert { + fn run<'a>(&self, node: &AstNode<'a>, ctx: &LintContext<'a>) { + let AstKind::ImportDeclaration(import_decl) = node.kind() else { return }; + + if !is_assert_module_import(import_decl) { + return; + } + + for imported_assert_symbol_id in find_assert_imports(import_decl) { + check_assert_calls(imported_assert_symbol_id, ctx); + } + } +} + +fn is_assert_module_import(import_decl: &ImportDeclaration) -> bool { + is_assert_module(import_decl) || is_strict_assert_module(import_decl) +} + +fn is_assert_module(import_decl: &ImportDeclaration) -> bool { + let module_name = import_decl.source.value.as_str(); + ["assert", "node:assert"].contains(&module_name) +} + +fn is_strict_assert_module(import_decl: &ImportDeclaration) -> bool { + let module_name = import_decl.source.value.as_str(); + ["assert/strict", "node:assert/strict"].contains(&module_name) +} + +fn find_assert_imports(import_decl: &ImportDeclaration<'_>) -> Vec { + let mut assert_imports: Vec = Vec::new(); + + if let Some(specifiers) = &import_decl.specifiers { + for specifier in specifiers { + match specifier { + ImportDeclarationSpecifier::ImportDefaultSpecifier(default_specifier) => { + assert_imports.push(default_specifier.local.symbol_id()); + } + ImportDeclarationSpecifier::ImportSpecifier(named_specifier) => { + let imported = &named_specifier.imported; + if imported.name() == "default" + || (is_assert_module(import_decl) && imported.name() == "strict") + { + assert_imports.push(named_specifier.local.symbol_id()); + } + } + ImportDeclarationSpecifier::ImportNamespaceSpecifier(_) => {} + } + } + } + + assert_imports +} + +fn check_assert_calls(symbol_id: SymbolId, ctx: &LintContext<'_>) { + let references = ctx.semantic().symbol_references(symbol_id); + + for reference in references { + let Some(parent) = ctx.nodes().parent_node(reference.node_id()) else { + continue; + }; + + match parent.kind() { + AstKind::CallExpression(call_expr) => { + if let Expression::Identifier(ident) = &call_expr.callee { + ctx.diagnostic_with_fix( + consistent_assert_diagnostic(&ident.name, ident.span), + |fixer| fixer.insert_text_after(&ident.span, ".ok"), + ); + } + } + AstKind::ParenthesizedExpression(paren_expr) => { + let Expression::Identifier(ident) = &paren_expr.expression else { + continue; + }; + ctx.diagnostic_with_fix( + consistent_assert_diagnostic(&ident.name, ident.span), + |fixer| fixer.insert_text_after(&ident.span, ".ok"), + ); + } + _ => {} + } + } +} + +#[test] +fn test() { + use crate::tester::Tester; + + let pass = vec![ + "assert(foo)", + r#"import assert from "assert";"#, + "import assert from 'node:assert'; + assert;", + "import customAssert from 'node:assert'; + assert(foo);", + "function foo (assert) { + assert(bar); + }", + "import assert from 'node:assert'; + function foo (assert) { + assert(bar); + }", + "import {strict} from 'node:assert/strict'; + strict(foo);", + "import * as assert from 'node:assert'; + assert(foo);", + "export * as assert from 'node:assert'; + assert(foo);", + "export {default as assert} from 'node:assert'; + export {assert as strict} from 'node:assert'; + assert(foo);", + "import assert from 'node:assert/strict'; + console.log(assert)", + ]; + + let fail = vec![ + "import assert from 'assert'; + assert(foo)", + "import assert from 'node:assert'; + assert(foo)", + "import assert from 'assert/strict'; + assert(foo)", + "import assert from 'node:assert/strict'; + assert(foo)", + "import customAssert from 'assert'; + customAssert(foo)", + "import customAssert from 'node:assert'; + customAssert(foo)", + "import assert from 'assert'; + assert(foo) + assert(bar) + assert(baz)", + "import {strict} from 'assert'; + strict(foo)", + "import {strict as assert} from 'assert'; + assert(foo)", + "import a, {strict as b, default as c} from 'node:assert'; + import d, {strict as e, default as f} from 'assert'; + import g, {default as h} from 'node:assert/strict'; + import i, {default as j} from 'assert/strict'; + a(foo); + b(foo); + c(foo); + d(foo); + e(foo); + f(foo); + g(foo); + h(foo); + i(foo); + j(foo);", + "import assert from 'node:assert'; + assert?.(foo)", + "import assert from 'assert'; + (( + /* comment */ (( + /* comment */ + assert + /* comment */ + )) /* comment */ + (/* comment */ typeof foo === 'string', 'foo must be a string' /** after comment */) + ));", + ]; + + let fix = vec![( + "import assert from 'assert'; + assert(foo)", + "import assert from 'assert'; + assert.ok(foo)", + ), ( + "import assert from 'node:assert'; + assert(foo)", + "import assert from 'node:assert'; + assert.ok(foo)", + ), ( + "import assert from 'assert/strict'; + assert(foo)", + "import assert from 'assert/strict'; + assert.ok(foo)", + ), ( + "import assert from 'node:assert/strict'; + assert(foo)", + "import assert from 'node:assert/strict'; + assert.ok(foo)", + ), ( + "import customAssert from 'assert'; + customAssert(foo)", + "import customAssert from 'assert'; + customAssert.ok(foo)", + ), ( + "import customAssert from 'node:assert'; + customAssert(foo)", + "import customAssert from 'node:assert'; + customAssert.ok(foo)", + ), ( + "import assert from 'assert'; + assert(foo) + assert(bar) + assert(baz)", + "import assert from 'assert'; + assert.ok(foo) + assert.ok(bar) + assert.ok(baz)", + ), ( + "import {strict} from 'assert'; + strict(foo)", + "import {strict} from 'assert'; + strict.ok(foo)", + ), ( + "import {strict as assert} from 'assert'; + assert(foo)", + "import {strict as assert} from 'assert'; + assert.ok(foo)", + ), ( + "import a, {strict as b, default as c} from 'node:assert'; + import d, {strict as e, default as f} from 'assert'; + import g, {default as h} from 'node:assert/strict'; + import i, {default as j} from 'assert/strict'; + a(foo); + b(foo); + c(foo); + d(foo); + e(foo); + f(foo); + g(foo); + h(foo); + i(foo); + j(foo);", + "import a, {strict as b, default as c} from 'node:assert'; + import d, {strict as e, default as f} from 'assert'; + import g, {default as h} from 'node:assert/strict'; + import i, {default as j} from 'assert/strict'; + a.ok(foo); + b.ok(foo); + c.ok(foo); + d.ok(foo); + e.ok(foo); + f.ok(foo); + g.ok(foo); + h.ok(foo); + i.ok(foo); + j.ok(foo);", + ), ( + "import assert from 'node:assert'; + assert?.(foo)", + "import assert from 'node:assert'; + assert.ok?.(foo)", + ), ( + "import assert from 'assert'; + (( + /* comment */ (( + /* comment */ + assert + /* comment */ + )) /* comment */ + (/* comment */ typeof foo === 'string', 'foo must be a string' /** after comment */) + ));", + "import assert from 'assert'; + (( + /* comment */ (( + /* comment */ + assert.ok + /* comment */ + )) /* comment */ + (/* comment */ typeof foo === 'string', 'foo must be a string' /** after comment */) + ));", + )]; + + Tester::new(ConsistentAssert::NAME, ConsistentAssert::PLUGIN, pass, fail) + .expect_fix(fix) + .test_and_snapshot(); +} diff --git a/crates/oxc_linter/src/snapshots/unicorn_consistent_assert.snap b/crates/oxc_linter/src/snapshots/unicorn_consistent_assert.snap new file mode 100644 index 0000000000000..ec7eef4f80232 --- /dev/null +++ b/crates/oxc_linter/src/snapshots/unicorn_consistent_assert.snap @@ -0,0 +1,198 @@ +--- +source: crates/oxc_linter/src/tester.rs +--- + ⚠ eslint-plugin-unicorn(consistent-assert): Inconsistent assert usage + ╭─[consistent_assert.tsx:2:10] + 1 │ import assert from 'assert'; + 2 │ assert(foo) + · ────── + ╰──── + help: Prefer assert.ok(...) over assert(...) + + ⚠ eslint-plugin-unicorn(consistent-assert): Inconsistent assert usage + ╭─[consistent_assert.tsx:2:10] + 1 │ import assert from 'node:assert'; + 2 │ assert(foo) + · ────── + ╰──── + help: Prefer assert.ok(...) over assert(...) + + ⚠ eslint-plugin-unicorn(consistent-assert): Inconsistent assert usage + ╭─[consistent_assert.tsx:2:10] + 1 │ import assert from 'assert/strict'; + 2 │ assert(foo) + · ────── + ╰──── + help: Prefer assert.ok(...) over assert(...) + + ⚠ eslint-plugin-unicorn(consistent-assert): Inconsistent assert usage + ╭─[consistent_assert.tsx:2:10] + 1 │ import assert from 'node:assert/strict'; + 2 │ assert(foo) + · ────── + ╰──── + help: Prefer assert.ok(...) over assert(...) + + ⚠ eslint-plugin-unicorn(consistent-assert): Inconsistent assert usage + ╭─[consistent_assert.tsx:2:10] + 1 │ import customAssert from 'assert'; + 2 │ customAssert(foo) + · ──────────── + ╰──── + help: Prefer customAssert.ok(...) over customAssert(...) + + ⚠ eslint-plugin-unicorn(consistent-assert): Inconsistent assert usage + ╭─[consistent_assert.tsx:2:10] + 1 │ import customAssert from 'node:assert'; + 2 │ customAssert(foo) + · ──────────── + ╰──── + help: Prefer customAssert.ok(...) over customAssert(...) + + ⚠ eslint-plugin-unicorn(consistent-assert): Inconsistent assert usage + ╭─[consistent_assert.tsx:2:10] + 1 │ import assert from 'assert'; + 2 │ assert(foo) + · ────── + 3 │ assert(bar) + ╰──── + help: Prefer assert.ok(...) over assert(...) + + ⚠ eslint-plugin-unicorn(consistent-assert): Inconsistent assert usage + ╭─[consistent_assert.tsx:3:10] + 2 │ assert(foo) + 3 │ assert(bar) + · ────── + 4 │ assert(baz) + ╰──── + help: Prefer assert.ok(...) over assert(...) + + ⚠ eslint-plugin-unicorn(consistent-assert): Inconsistent assert usage + ╭─[consistent_assert.tsx:4:10] + 3 │ assert(bar) + 4 │ assert(baz) + · ────── + ╰──── + help: Prefer assert.ok(...) over assert(...) + + ⚠ eslint-plugin-unicorn(consistent-assert): Inconsistent assert usage + ╭─[consistent_assert.tsx:2:10] + 1 │ import {strict} from 'assert'; + 2 │ strict(foo) + · ────── + ╰──── + help: Prefer strict.ok(...) over strict(...) + + ⚠ eslint-plugin-unicorn(consistent-assert): Inconsistent assert usage + ╭─[consistent_assert.tsx:2:10] + 1 │ import {strict as assert} from 'assert'; + 2 │ assert(foo) + · ────── + ╰──── + help: Prefer assert.ok(...) over assert(...) + + ⚠ eslint-plugin-unicorn(consistent-assert): Inconsistent assert usage + ╭─[consistent_assert.tsx:5:10] + 4 │ import i, {default as j} from 'assert/strict'; + 5 │ a(foo); + · ─ + 6 │ b(foo); + ╰──── + help: Prefer a.ok(...) over a(...) + + ⚠ eslint-plugin-unicorn(consistent-assert): Inconsistent assert usage + ╭─[consistent_assert.tsx:6:10] + 5 │ a(foo); + 6 │ b(foo); + · ─ + 7 │ c(foo); + ╰──── + help: Prefer b.ok(...) over b(...) + + ⚠ eslint-plugin-unicorn(consistent-assert): Inconsistent assert usage + ╭─[consistent_assert.tsx:7:10] + 6 │ b(foo); + 7 │ c(foo); + · ─ + 8 │ d(foo); + ╰──── + help: Prefer c.ok(...) over c(...) + + ⚠ eslint-plugin-unicorn(consistent-assert): Inconsistent assert usage + ╭─[consistent_assert.tsx:8:10] + 7 │ c(foo); + 8 │ d(foo); + · ─ + 9 │ e(foo); + ╰──── + help: Prefer d.ok(...) over d(...) + + ⚠ eslint-plugin-unicorn(consistent-assert): Inconsistent assert usage + ╭─[consistent_assert.tsx:9:10] + 8 │ d(foo); + 9 │ e(foo); + · ─ + 10 │ f(foo); + ╰──── + help: Prefer e.ok(...) over e(...) + + ⚠ eslint-plugin-unicorn(consistent-assert): Inconsistent assert usage + ╭─[consistent_assert.tsx:10:10] + 9 │ e(foo); + 10 │ f(foo); + · ─ + 11 │ g(foo); + ╰──── + help: Prefer f.ok(...) over f(...) + + ⚠ eslint-plugin-unicorn(consistent-assert): Inconsistent assert usage + ╭─[consistent_assert.tsx:11:10] + 10 │ f(foo); + 11 │ g(foo); + · ─ + 12 │ h(foo); + ╰──── + help: Prefer g.ok(...) over g(...) + + ⚠ eslint-plugin-unicorn(consistent-assert): Inconsistent assert usage + ╭─[consistent_assert.tsx:12:10] + 11 │ g(foo); + 12 │ h(foo); + · ─ + 13 │ i(foo); + ╰──── + help: Prefer h.ok(...) over h(...) + + ⚠ eslint-plugin-unicorn(consistent-assert): Inconsistent assert usage + ╭─[consistent_assert.tsx:13:10] + 12 │ h(foo); + 13 │ i(foo); + · ─ + 14 │ j(foo); + ╰──── + help: Prefer i.ok(...) over i(...) + + ⚠ eslint-plugin-unicorn(consistent-assert): Inconsistent assert usage + ╭─[consistent_assert.tsx:14:10] + 13 │ i(foo); + 14 │ j(foo); + · ─ + ╰──── + help: Prefer j.ok(...) over j(...) + + ⚠ eslint-plugin-unicorn(consistent-assert): Inconsistent assert usage + ╭─[consistent_assert.tsx:2:10] + 1 │ import assert from 'node:assert'; + 2 │ assert?.(foo) + · ────── + ╰──── + help: Prefer assert.ok(...) over assert(...) + + ⚠ eslint-plugin-unicorn(consistent-assert): Inconsistent assert usage + ╭─[consistent_assert.tsx:5:6] + 4 │ /* comment */ + 5 │ assert + · ────── + 6 │ /* comment */ + ╰──── + help: Prefer assert.ok(...) over assert(...)