diff --git a/apps/oxlint/fixtures/auto_config_detection/.oxlintrc.json b/apps/oxlint/fixtures/auto_config_detection/.oxlintrc.json index a63d73a1442b8..0e1a1b145a30a 100644 --- a/apps/oxlint/fixtures/auto_config_detection/.oxlintrc.json +++ b/apps/oxlint/fixtures/auto_config_detection/.oxlintrc.json @@ -1,4 +1,7 @@ { + "categories": { + "correctness": "off" + }, "rules": { "no-debugger": "error" } diff --git a/apps/oxlint/fixtures/cross_module_extended_config/config/.oxlintrc.json b/apps/oxlint/fixtures/cross_module_extended_config/config/.oxlintrc.json index 7d258733b4493..115fe712427ff 100644 --- a/apps/oxlint/fixtures/cross_module_extended_config/config/.oxlintrc.json +++ b/apps/oxlint/fixtures/cross_module_extended_config/config/.oxlintrc.json @@ -1,4 +1,7 @@ { + "categories": { + "correctness": "off" + }, "plugins": [ "import" ], diff --git a/apps/oxlint/fixtures/ignore_file_current_dir/.oxlintrc.json b/apps/oxlint/fixtures/ignore_file_current_dir/.oxlintrc.json index 78e9b4bef1c20..b915b9f05d99b 100644 --- a/apps/oxlint/fixtures/ignore_file_current_dir/.oxlintrc.json +++ b/apps/oxlint/fixtures/ignore_file_current_dir/.oxlintrc.json @@ -1,4 +1,7 @@ { + "categories": { + "correctness": "off" + }, "ignorePatterns": [ "foo.js", "a/bar.js" diff --git a/apps/oxlint/fixtures/ignore_patterns_relative/.oxlintrc.json b/apps/oxlint/fixtures/ignore_patterns_relative/.oxlintrc.json index 7bdffc6c71844..c402ee9f327a0 100644 --- a/apps/oxlint/fixtures/ignore_patterns_relative/.oxlintrc.json +++ b/apps/oxlint/fixtures/ignore_patterns_relative/.oxlintrc.json @@ -1,3 +1,9 @@ { + "categories": { + "correctness": "off" + }, + "rules": { + "no-debugger": "warn" + }, "ignorePatterns": ["nested/*.ts"] } diff --git a/apps/oxlint/fixtures/ignore_patterns_whitelist/.oxlintrc.json b/apps/oxlint/fixtures/ignore_patterns_whitelist/.oxlintrc.json index 0044ce11bd7ae..c9c862de4cb44 100644 --- a/apps/oxlint/fixtures/ignore_patterns_whitelist/.oxlintrc.json +++ b/apps/oxlint/fixtures/ignore_patterns_whitelist/.oxlintrc.json @@ -1,4 +1,7 @@ { + "categories": { + "correctness": "off" + }, "rules": { "no-debugger": "error" }, diff --git a/apps/oxlint/fixtures/import/.oxlintrc-import-x.json b/apps/oxlint/fixtures/import/.oxlintrc-import-x.json index 44f2576210568..73a4e52f84c69 100644 --- a/apps/oxlint/fixtures/import/.oxlintrc-import-x.json +++ b/apps/oxlint/fixtures/import/.oxlintrc-import-x.json @@ -1,5 +1,8 @@ { "plugins": ["import"], + "categories": { + "correctness": "off" + }, "rules": { "import-x/no-default-export": "error", "import-x/namespace": "allow" diff --git a/apps/oxlint/fixtures/import/.oxlintrc.json b/apps/oxlint/fixtures/import/.oxlintrc.json index fc645f90991be..c5f1df9397d5c 100644 --- a/apps/oxlint/fixtures/import/.oxlintrc.json +++ b/apps/oxlint/fixtures/import/.oxlintrc.json @@ -1,5 +1,8 @@ { "plugins": ["import"], + "categories": { + "correctness": "off" + }, "rules": { "import/no-default-export": "error", "import/namespace": "allow" diff --git a/apps/oxlint/fixtures/output_formatter_diagnostic/.oxlintrc.json b/apps/oxlint/fixtures/output_formatter_diagnostic/.oxlintrc.json index 1f40dc74759bb..db4474012ec55 100644 --- a/apps/oxlint/fixtures/output_formatter_diagnostic/.oxlintrc.json +++ b/apps/oxlint/fixtures/output_formatter_diagnostic/.oxlintrc.json @@ -1,6 +1,9 @@ { - "rules": { - "no-debugger": "error", - "no-unused-vars": "warn" - } -} \ No newline at end of file + "categories": { + "correctness": "off" + }, + "rules": { + "no-debugger": "error", + "no-unused-vars": "warn" + } +} diff --git a/apps/oxlint/src/snapshots/fixtures__auto_config_detection_debugger.js@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__auto_config_detection_debugger.js@oxlint.snap index 183300e195b7f..b7c0654cfae78 100644 --- a/apps/oxlint/src/snapshots/fixtures__auto_config_detection_debugger.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__auto_config_detection_debugger.js@oxlint.snap @@ -14,7 +14,7 @@ working directory: fixtures/auto_config_detection help: Remove the debugger statement Found 0 warnings and 1 error. -Finished in ms on 1 file using 1 threads. +Finished in ms on 1 file with 1 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__cross_module_extended_config_@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__cross_module_extended_config_@oxlint.snap index 24e274d76745d..a38d4a4d40ff2 100644 --- a/apps/oxlint/src/snapshots/fixtures__cross_module_extended_config_@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__cross_module_extended_config_@oxlint.snap @@ -29,7 +29,7 @@ working directory: fixtures/cross_module_extended_config -> ./dep-b.ts - fixtures/cross_module_extended_config/dep-b.ts Found 0 warnings and 2 errors. -Finished in ms on 2 files using 1 threads. +Finished in ms on 2 files with 1 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__cross_module_nested_config_@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__cross_module_nested_config_@oxlint.snap index d0ae5d298784b..75799fa53b416 100644 --- a/apps/oxlint/src/snapshots/fixtures__cross_module_nested_config_@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__cross_module_nested_config_@oxlint.snap @@ -29,7 +29,7 @@ working directory: fixtures/cross_module_nested_config -> ./folder-dep-b.ts - fixtures/cross_module_nested_config/folder/folder-dep-b.ts Found 0 warnings and 2 errors. -Finished in ms on 4 files using 1 threads. +Finished in ms on 4 files with 90 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__disable_directive_issue_13311_test.jsx test2.d.ts@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__disable_directive_issue_13311_test.jsx test2.d.ts@oxlint.snap index 591a3fd493920..12985f401edcf 100644 --- a/apps/oxlint/src/snapshots/fixtures__disable_directive_issue_13311_test.jsx test2.d.ts@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__disable_directive_issue_13311_test.jsx test2.d.ts@oxlint.snap @@ -6,7 +6,7 @@ arguments: test.jsx test2.d.ts working directory: fixtures/disable_directive_issue_13311 ---------- Found 0 warnings and 0 errors. -Finished in ms on 2 files using 1 threads. +Finished in ms on 2 files with 3 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__extends_config_overrides@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__extends_config_overrides@oxlint.snap index 6ffe2e49acfa1..8a5aaecdbc956 100644 --- a/apps/oxlint/src/snapshots/fixtures__extends_config_overrides@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__extends_config_overrides@oxlint.snap @@ -40,7 +40,7 @@ working directory: fixtures/extends_config help: Provide an `href` for the `a` element. Found 1 warning and 3 errors. -Finished in ms on 2 files using 1 threads. +Finished in ms on 2 files with 90 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- 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 8d23cffeb309b..5f6db82af5b1c 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 using 1 threads. +Finished in ms on 0 files with 1 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 using 1 threads. +Finished in ms on 0 files with 1 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__ignore_patterns_relative_ .@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__ignore_patterns_relative_ .@oxlint.snap index 22ead24cfbf6f..0c2910cd66d55 100644 --- a/apps/oxlint/src/snapshots/fixtures__ignore_patterns_relative_ .@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__ignore_patterns_relative_ .@oxlint.snap @@ -21,7 +21,7 @@ working directory: fixtures/ignore_patterns_relative help: Remove the debugger statement Found 2 warnings and 0 errors. -Finished in ms on 2 files using 1 threads. +Finished in ms on 2 files with 1 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- @@ -46,7 +46,7 @@ working directory: fixtures/ignore_patterns_relative help: Remove the debugger statement Found 2 warnings and 0 errors. -Finished in ms on 2 files using 1 threads. +Finished in ms on 2 files with 1 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__ignore_patterns_symlink_ .@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__ignore_patterns_symlink_ .@oxlint.snap index aa16d86db65c9..8ba0404a1e885 100644 --- a/apps/oxlint/src/snapshots/fixtures__ignore_patterns_symlink_ .@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__ignore_patterns_symlink_ .@oxlint.snap @@ -6,7 +6,7 @@ arguments: working directory: fixtures/ignore_patterns_symlink ---------- Found 0 warnings and 0 errors. -Finished in ms on 0 files using 1 threads. +Finished in ms on 0 files with 90 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- @@ -16,7 +16,7 @@ arguments: . working directory: fixtures/ignore_patterns_symlink ---------- Found 0 warnings and 0 errors. -Finished in ms on 0 files using 1 threads. +Finished in ms on 0 files with 90 rules using 1 threads. ---------- CLI result: LintSucceeded ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__ignore_patterns_whitelist_ .@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__ignore_patterns_whitelist_ .@oxlint.snap index f5842cc8af37c..57f5608d05456 100644 --- a/apps/oxlint/src/snapshots/fixtures__ignore_patterns_whitelist_ .@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__ignore_patterns_whitelist_ .@oxlint.snap @@ -14,7 +14,7 @@ working directory: fixtures/ignore_patterns_whitelist help: Remove the debugger statement Found 0 warnings and 1 error. -Finished in ms on 1 file using 1 threads. +Finished in ms on 1 file with 1 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- @@ -32,7 +32,7 @@ working directory: fixtures/ignore_patterns_whitelist help: Remove the debugger statement Found 0 warnings and 1 error. -Finished in ms on 1 file using 1 threads. +Finished in ms on 1 file with 1 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__import_-c .oxlintrc.json test.js -c .oxlintrc-import-x.json test.js@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__import_-c .oxlintrc.json test.js -c .oxlintrc-import-x.json test.js@oxlint.snap index 82064d0e4423b..53880fe1d44b3 100644 --- a/apps/oxlint/src/snapshots/fixtures__import_-c .oxlintrc.json test.js -c .oxlintrc-import-x.json test.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__import_-c .oxlintrc.json test.js -c .oxlintrc-import-x.json test.js@oxlint.snap @@ -15,7 +15,7 @@ working directory: fixtures/import `---- Found 0 warnings and 1 error. -Finished in ms on 1 file with 55 rules using 1 threads. +Finished in ms on 1 file with 1 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- @@ -34,7 +34,7 @@ working directory: fixtures/import `---- Found 0 warnings and 1 error. -Finished in ms on 1 file with 55 rules using 1 threads. +Finished in ms on 1 file with 1 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__output_formatter_diagnostic_--format=default test.js@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__output_formatter_diagnostic_--format=default test.js@oxlint.snap index 0c66a71ba8936..1d224ff06b16d 100644 --- a/apps/oxlint/src/snapshots/fixtures__output_formatter_diagnostic_--format=default test.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__output_formatter_diagnostic_--format=default test.js@oxlint.snap @@ -33,7 +33,7 @@ working directory: fixtures/output_formatter_diagnostic help: Remove the debugger statement Found 2 warnings and 1 error. -Finished in ms on 1 file using 1 threads. +Finished in ms on 1 file with 2 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__output_formatter_diagnostic_--format=json test.js@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__output_formatter_diagnostic_--format=json test.js@oxlint.snap index 6a6af5b0e07df..5249dd7ca08bb 100644 --- a/apps/oxlint/src/snapshots/fixtures__output_formatter_diagnostic_--format=json test.js@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__output_formatter_diagnostic_--format=json test.js@oxlint.snap @@ -9,7 +9,7 @@ working directory: fixtures/output_formatter_diagnostic {"message": "Function 'foo' is declared but never used.","code": "eslint(no-unused-vars)","severity": "warning","causes": [],"url": "https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-unused-vars.html","help": "Consider removing this declaration.","filename": "test.js","labels": [{"label": "'foo' is declared here","span": {"offset": 9,"length": 3,"line": 1,"column": 10}}],"related": []}, {"message": "Parameter 'b' is declared but never used. Unused parameters should start with a '_'.","code": "eslint(no-unused-vars)","severity": "warning","causes": [],"url": "https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-unused-vars.html","help": "Consider removing this parameter.","filename": "test.js","labels": [{"label": "'b' is declared here","span": {"offset": 16,"length": 1,"line": 1,"column": 17}}],"related": []}], "number_of_files": 1, - "number_of_rules": null, + "number_of_rules": 2, "threads_count": 1, "start_time": } diff --git a/apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware --silent@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware --silent@oxlint.snap index d46e015cad82a..1658dfc749e20 100644 --- a/apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware --silent@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware --silent@oxlint.snap @@ -7,7 +7,7 @@ working directory: fixtures/tsgolint ---------- Found 0 warnings and 51 errors. -Finished in ms on 45 files using 1 threads. +Finished in ms on 45 files with 44 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware test.svelte@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware test.svelte@oxlint.snap index 646da312689a7..aac31cf0d0ba7 100644 --- a/apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware test.svelte@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware test.svelte@oxlint.snap @@ -16,7 +16,7 @@ working directory: fixtures/tsgolint help: Remove the debugger statement Found 0 warnings and 1 error. -Finished in ms on 1 file using 1 threads. +Finished in ms on 1 file with 44 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware@oxlint.snap index 7f2814f22d1f9..6af68cd19ab87 100644 --- a/apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__tsgolint_--type-aware@oxlint.snap @@ -397,7 +397,7 @@ working directory: fixtures/tsgolint `---- Found 0 warnings and 51 errors. -Finished in ms on 45 files using 1 threads. +Finished in ms on 45 files with 44 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__tsgolint_rule_options_--type-aware@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__tsgolint_rule_options_--type-aware@oxlint.snap index 2a5717793b952..f9cbc1eeb1a27 100644 --- a/apps/oxlint/src/snapshots/fixtures__tsgolint_rule_options_--type-aware@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__tsgolint_rule_options_--type-aware@oxlint.snap @@ -39,7 +39,7 @@ working directory: fixtures/tsgolint_rule_options `---- Found 0 warnings and 4 errors. -Finished in ms on 1 file using 1 threads. +Finished in ms on 1 file with 6 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- diff --git a/apps/oxlint/src/snapshots/fixtures__tsgolint_type_error_--type-aware --type-check@oxlint.snap b/apps/oxlint/src/snapshots/fixtures__tsgolint_type_error_--type-aware --type-check@oxlint.snap index 44acd309dde12..42e2369699f54 100644 --- a/apps/oxlint/src/snapshots/fixtures__tsgolint_type_error_--type-aware --type-check@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures__tsgolint_type_error_--type-aware --type-check@oxlint.snap @@ -13,7 +13,7 @@ working directory: fixtures/tsgolint_type_error `---- Found 0 warnings and 1 error. -Finished in ms on 2 files using 1 threads. +Finished in ms on 2 files with 2 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- diff --git a/apps/oxlint/src/snapshots/fixtures_issue_10054@oxlint.snap b/apps/oxlint/src/snapshots/fixtures_issue_10054@oxlint.snap index 1a269056463c9..52b14d39efe37 100644 --- a/apps/oxlint/src/snapshots/fixtures_issue_10054@oxlint.snap +++ b/apps/oxlint/src/snapshots/fixtures_issue_10054@oxlint.snap @@ -27,7 +27,7 @@ working directory: fixtures -> ./b - fixtures/issue_10054/b.ts Found 0 warnings and 2 errors. -Finished in ms on 2 files using 1 threads. +Finished in ms on 2 files with 90 rules using 1 threads. ---------- CLI result: LintFoundErrors ---------- diff --git a/apps/oxlint/test/fixtures/basic/output.snap.md b/apps/oxlint/test/fixtures/basic/output.snap.md index 379bbfd6a467f..12db6317d78ce 100644 --- a/apps/oxlint/test/fixtures/basic/output.snap.md +++ b/apps/oxlint/test/fixtures/basic/output.snap.md @@ -17,7 +17,7 @@ help: Remove the debugger statement Found 1 warning and 1 error. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 90 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/basic_many_files/.oxlintrc.json b/apps/oxlint/test/fixtures/basic_many_files/.oxlintrc.json index 10863723e89de..a90245eb7e884 100644 --- a/apps/oxlint/test/fixtures/basic_many_files/.oxlintrc.json +++ b/apps/oxlint/test/fixtures/basic_many_files/.oxlintrc.json @@ -1,4 +1,7 @@ { + "categories": { + "correctness": "warn" // explicitly enable this so we can ensure import rules are enabled. + }, "jsPlugins": ["./plugin.ts"], "plugins": ["import"], "rules": { diff --git a/apps/oxlint/test/fixtures/basic_many_files/output.snap.md b/apps/oxlint/test/fixtures/basic_many_files/output.snap.md index 15987d8da2cc2..bab4776956e42 100644 --- a/apps/oxlint/test/fixtures/basic_many_files/output.snap.md +++ b/apps/oxlint/test/fixtures/basic_many_files/output.snap.md @@ -264,7 +264,7 @@ help: Remove the debugger statement Found 20 warnings and 20 errors. -Finished in Xms on 20 files using X threads. +Finished in Xms on 20 files with 55 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/basic_multiple_rules/.oxlintrc.json b/apps/oxlint/test/fixtures/basic_multiple_rules/.oxlintrc.json index 50897d6f21757..f43a85184b9d4 100644 --- a/apps/oxlint/test/fixtures/basic_multiple_rules/.oxlintrc.json +++ b/apps/oxlint/test/fixtures/basic_multiple_rules/.oxlintrc.json @@ -1,8 +1,12 @@ { + "categories": { + "correctness": "off" + }, "jsPlugins": ["./plugin.ts"], "rules": { "basic-custom-plugin/no-debugger": "error", "basic-custom-plugin/no-debugger-2": "error", - "basic-custom-plugin/no-identifiers-named-foo": "error" + "basic-custom-plugin/no-identifiers-named-foo": "error", + "eslint/no-debugger": "warn" } } diff --git a/apps/oxlint/test/fixtures/basic_multiple_rules/output.snap.md b/apps/oxlint/test/fixtures/basic_multiple_rules/output.snap.md index 85ebc1970724c..5adc8d6df832a 100644 --- a/apps/oxlint/test/fixtures/basic_multiple_rules/output.snap.md +++ b/apps/oxlint/test/fixtures/basic_multiple_rules/output.snap.md @@ -32,16 +32,8 @@ : ^^^ `---- - ! ]8;;https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-unused-expressions.html\eslint(no-unused-expressions)]8;;\: Expected expression to be used - ,-[files/index.js:3:1] - 2 | - 3 | foo; - : ^^^^ - `---- - help: Consider using this expression or removing it - -Found 2 warnings and 3 errors. -Finished in Xms on 1 file using X threads. +Found 1 warning and 3 errors. +Finished in Xms on 1 file with 1 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/basic_no_errors/.oxlintrc.json b/apps/oxlint/test/fixtures/basic_no_errors/.oxlintrc.json index 9d64fb3636b2d..6d63978df267d 100644 --- a/apps/oxlint/test/fixtures/basic_no_errors/.oxlintrc.json +++ b/apps/oxlint/test/fixtures/basic_no_errors/.oxlintrc.json @@ -1,4 +1,7 @@ { + "categories": { + "correctness": "off" + }, "jsPlugins": ["./plugin.ts"], "rules": { "basic-custom-plugin/no-debugger": "error" diff --git a/apps/oxlint/test/fixtures/basic_no_errors/output.snap.md b/apps/oxlint/test/fixtures/basic_no_errors/output.snap.md index 65a20a5872150..ec092643ded0b 100644 --- a/apps/oxlint/test/fixtures/basic_no_errors/output.snap.md +++ b/apps/oxlint/test/fixtures/basic_no_errors/output.snap.md @@ -4,7 +4,7 @@ # stdout ``` Found 0 warnings and 0 errors. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/basic_warn_severity/.oxlintrc.json b/apps/oxlint/test/fixtures/basic_warn_severity/.oxlintrc.json index 7a92c43dcf652..bb063f08cfa33 100644 --- a/apps/oxlint/test/fixtures/basic_warn_severity/.oxlintrc.json +++ b/apps/oxlint/test/fixtures/basic_warn_severity/.oxlintrc.json @@ -1,6 +1,10 @@ { + "categories": { + "correctness": "off" + }, "jsPlugins": ["./plugin.ts"], "rules": { - "basic-custom-plugin/no-debugger": "warn" + "basic-custom-plugin/no-debugger": "warn", + "eslint/no-debugger": "warn" } } diff --git a/apps/oxlint/test/fixtures/basic_warn_severity/output.snap.md b/apps/oxlint/test/fixtures/basic_warn_severity/output.snap.md index 444440fe2b40e..1fba872021391 100644 --- a/apps/oxlint/test/fixtures/basic_warn_severity/output.snap.md +++ b/apps/oxlint/test/fixtures/basic_warn_severity/output.snap.md @@ -17,7 +17,7 @@ help: Remove the debugger statement Found 2 warnings and 0 errors. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 1 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/built_in_errors/output.snap.md b/apps/oxlint/test/fixtures/built_in_errors/output.snap.md index 81809c9b92642..ec325c0d142d1 100644 --- a/apps/oxlint/test/fixtures/built_in_errors/output.snap.md +++ b/apps/oxlint/test/fixtures/built_in_errors/output.snap.md @@ -11,7 +11,7 @@ help: Remove the debugger statement Found 0 warnings and 1 error. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 1 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/built_in_no_errors/output.snap.md b/apps/oxlint/test/fixtures/built_in_no_errors/output.snap.md index 56806f4a07814..fd59343d03344 100644 --- a/apps/oxlint/test/fixtures/built_in_no_errors/output.snap.md +++ b/apps/oxlint/test/fixtures/built_in_no_errors/output.snap.md @@ -4,7 +4,7 @@ # stdout ``` Found 0 warnings and 0 errors. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 1 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/cfg/output.snap.md b/apps/oxlint/test/fixtures/cfg/output.snap.md index 746534df0cdaa..b59b1cb757b9a 100644 --- a/apps/oxlint/test/fixtures/cfg/output.snap.md +++ b/apps/oxlint/test/fixtures/cfg/output.snap.md @@ -21,7 +21,7 @@ `---- Found 0 warnings and 1 error. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/comments/output.snap.md b/apps/oxlint/test/fixtures/comments/output.snap.md index 4f85a8ce10dcf..145ebaa232dfe 100644 --- a/apps/oxlint/test/fixtures/comments/output.snap.md +++ b/apps/oxlint/test/fixtures/comments/output.snap.md @@ -456,7 +456,7 @@ `---- Found 0 warnings and 32 errors. -Finished in Xms on 3 files using X threads. +Finished in Xms on 3 files with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/context_properties/output.snap.md b/apps/oxlint/test/fixtures/context_properties/output.snap.md index 94fb9c1b4bbd6..68817b4e70c2c 100644 --- a/apps/oxlint/test/fixtures/context_properties/output.snap.md +++ b/apps/oxlint/test/fixtures/context_properties/output.snap.md @@ -46,7 +46,7 @@ `---- Found 0 warnings and 4 errors. -Finished in Xms on 2 files using X threads. +Finished in Xms on 2 files with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/context_wrapping/output.snap.md b/apps/oxlint/test/fixtures/context_wrapping/output.snap.md index 2a9857fb2fce0..3122dca62a7af 100644 --- a/apps/oxlint/test/fixtures/context_wrapping/output.snap.md +++ b/apps/oxlint/test/fixtures/context_wrapping/output.snap.md @@ -64,7 +64,7 @@ `---- Found 0 warnings and 10 errors. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/createOnce/output.snap.md b/apps/oxlint/test/fixtures/createOnce/output.snap.md index fd95ebaf94382..fd1df03a0c9db 100644 --- a/apps/oxlint/test/fixtures/createOnce/output.snap.md +++ b/apps/oxlint/test/fixtures/createOnce/output.snap.md @@ -352,7 +352,7 @@ `---- Found 0 warnings and 58 errors. -Finished in Xms on 2 files using X threads. +Finished in Xms on 2 files with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/definePlugin/output.snap.md b/apps/oxlint/test/fixtures/definePlugin/output.snap.md index c01e839e1f883..be30f96439707 100644 --- a/apps/oxlint/test/fixtures/definePlugin/output.snap.md +++ b/apps/oxlint/test/fixtures/definePlugin/output.snap.md @@ -259,7 +259,7 @@ `---- Found 0 warnings and 35 errors. -Finished in Xms on 2 files using X threads. +Finished in Xms on 2 files with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/definePlugin_and_defineRule/output.snap.md b/apps/oxlint/test/fixtures/definePlugin_and_defineRule/output.snap.md index 5c719816872b2..5158b5f455706 100644 --- a/apps/oxlint/test/fixtures/definePlugin_and_defineRule/output.snap.md +++ b/apps/oxlint/test/fixtures/definePlugin_and_defineRule/output.snap.md @@ -259,7 +259,7 @@ `---- Found 0 warnings and 35 errors. -Finished in Xms on 2 files using X threads. +Finished in Xms on 2 files with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/defineRule/output.snap.md b/apps/oxlint/test/fixtures/defineRule/output.snap.md index a8eb3e0f99222..39bb6ec53757d 100644 --- a/apps/oxlint/test/fixtures/defineRule/output.snap.md +++ b/apps/oxlint/test/fixtures/defineRule/output.snap.md @@ -259,7 +259,7 @@ `---- Found 0 warnings and 35 errors. -Finished in Xms on 2 files using X threads. +Finished in Xms on 2 files with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/diagnostic_loc/output.snap.md b/apps/oxlint/test/fixtures/diagnostic_loc/output.snap.md index 7c2b9101b51ec..ac2fd6edff571 100644 --- a/apps/oxlint/test/fixtures/diagnostic_loc/output.snap.md +++ b/apps/oxlint/test/fixtures/diagnostic_loc/output.snap.md @@ -33,7 +33,7 @@ `---- Found 0 warnings and 4 errors. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/disable_directives/output.snap.md b/apps/oxlint/test/fixtures/disable_directives/output.snap.md index f3b262a9fa047..81f8cd21b3b2c 100644 --- a/apps/oxlint/test/fixtures/disable_directives/output.snap.md +++ b/apps/oxlint/test/fixtures/disable_directives/output.snap.md @@ -43,7 +43,7 @@ `---- Found 0 warnings and 5 errors. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 1 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/estree/output.snap.md b/apps/oxlint/test/fixtures/estree/output.snap.md index 1ac53bc9dad75..2dc480f7dc61a 100644 --- a/apps/oxlint/test/fixtures/estree/output.snap.md +++ b/apps/oxlint/test/fixtures/estree/output.snap.md @@ -146,7 +146,7 @@ `---- Found 0 warnings and 9 errors. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/fixes/fix.snap.md b/apps/oxlint/test/fixtures/fixes/fix.snap.md index 8da76ee3bc05d..d6cadbcae4748 100644 --- a/apps/oxlint/test/fixtures/fixes/fix.snap.md +++ b/apps/oxlint/test/fixtures/fixes/fix.snap.md @@ -4,7 +4,7 @@ # stdout ``` Found 0 warnings and 0 errors. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/fixes/output.snap.md b/apps/oxlint/test/fixtures/fixes/output.snap.md index 9576474b22f79..e7f2206115d49 100644 --- a/apps/oxlint/test/fixtures/fixes/output.snap.md +++ b/apps/oxlint/test/fixtures/fixes/output.snap.md @@ -98,7 +98,7 @@ `---- Found 0 warnings and 12 errors. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/getNodeByRangeIndex/output.snap.md b/apps/oxlint/test/fixtures/getNodeByRangeIndex/output.snap.md index 0526bc37557f1..1ec7d3487434b 100644 --- a/apps/oxlint/test/fixtures/getNodeByRangeIndex/output.snap.md +++ b/apps/oxlint/test/fixtures/getNodeByRangeIndex/output.snap.md @@ -356,7 +356,7 @@ `---- Found 0 warnings and 45 errors. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/globals/output.snap.md b/apps/oxlint/test/fixtures/globals/output.snap.md index 1f7c5826d486d..8a8877389c949 100644 --- a/apps/oxlint/test/fixtures/globals/output.snap.md +++ b/apps/oxlint/test/fixtures/globals/output.snap.md @@ -66,7 +66,7 @@ `---- Found 0 warnings and 3 errors. -Finished in Xms on 3 files using X threads. +Finished in Xms on 3 files with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/isSpaceBetween/output.snap.md b/apps/oxlint/test/fixtures/isSpaceBetween/output.snap.md index ff6e4bff4a4fe..fb91a507c26cd 100644 --- a/apps/oxlint/test/fixtures/isSpaceBetween/output.snap.md +++ b/apps/oxlint/test/fixtures/isSpaceBetween/output.snap.md @@ -213,7 +213,7 @@ `---- Found 0 warnings and 13 errors. -Finished in Xms on 2 files using X threads. +Finished in Xms on 2 files with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/languageOptions/output.snap.md b/apps/oxlint/test/fixtures/languageOptions/output.snap.md index 89994c97d0800..bfefc824ef6f7 100644 --- a/apps/oxlint/test/fixtures/languageOptions/output.snap.md +++ b/apps/oxlint/test/fixtures/languageOptions/output.snap.md @@ -814,7 +814,7 @@ `---- Found 0 warnings and 4 errors. -Finished in Xms on 3 files using X threads. +Finished in Xms on 3 files with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/lint_after_hook_error/output.snap.md b/apps/oxlint/test/fixtures/lint_after_hook_error/output.snap.md index 85ec3ba5fef70..f90fb54f3a8ea 100644 --- a/apps/oxlint/test/fixtures/lint_after_hook_error/output.snap.md +++ b/apps/oxlint/test/fixtures/lint_after_hook_error/output.snap.md @@ -9,7 +9,7 @@ | at after (/plugin.ts:13:19) Found 0 warnings and 1 error. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/lint_before_hook_error/output.snap.md b/apps/oxlint/test/fixtures/lint_before_hook_error/output.snap.md index e410967a6b434..9964a79366d82 100644 --- a/apps/oxlint/test/fixtures/lint_before_hook_error/output.snap.md +++ b/apps/oxlint/test/fixtures/lint_before_hook_error/output.snap.md @@ -9,7 +9,7 @@ | at before (/plugin.ts:12:19) Found 0 warnings and 1 error. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/lint_create_error/output.snap.md b/apps/oxlint/test/fixtures/lint_create_error/output.snap.md index 271b3ed0c9ddd..85266c9a9063e 100644 --- a/apps/oxlint/test/fixtures/lint_create_error/output.snap.md +++ b/apps/oxlint/test/fixtures/lint_create_error/output.snap.md @@ -9,7 +9,7 @@ | at Object.create (/plugin.ts:10:15) Found 0 warnings and 1 error. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/lint_fix_error/output.snap.md b/apps/oxlint/test/fixtures/lint_fix_error/output.snap.md index b9d0596d8b9d2..c7d5f52dc55f0 100644 --- a/apps/oxlint/test/fixtures/lint_fix_error/output.snap.md +++ b/apps/oxlint/test/fixtures/lint_fix_error/output.snap.md @@ -10,7 +10,7 @@ | at Identifier (/plugin.ts:12:21) Found 0 warnings and 1 error. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/lint_visit_cfg_error/output.snap.md b/apps/oxlint/test/fixtures/lint_visit_cfg_error/output.snap.md index 942cb6210e42c..c12eb5c46e87c 100644 --- a/apps/oxlint/test/fixtures/lint_visit_cfg_error/output.snap.md +++ b/apps/oxlint/test/fixtures/lint_visit_cfg_error/output.snap.md @@ -21,7 +21,7 @@ `---- Found 0 warnings and 3 errors. -Finished in Xms on 2 files using X threads. +Finished in Xms on 2 files with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/lint_visit_error/output.snap.md b/apps/oxlint/test/fixtures/lint_visit_error/output.snap.md index 67aae8636ea91..7280bc856aa58 100644 --- a/apps/oxlint/test/fixtures/lint_visit_error/output.snap.md +++ b/apps/oxlint/test/fixtures/lint_visit_error/output.snap.md @@ -15,7 +15,7 @@ `---- Found 0 warnings and 2 errors. -Finished in Xms on 2 files using X threads. +Finished in Xms on 2 files with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/load_paths/.oxlintrc.json b/apps/oxlint/test/fixtures/load_paths/.oxlintrc.json index afe6ad26585b9..53f8b42ad9400 100644 --- a/apps/oxlint/test/fixtures/load_paths/.oxlintrc.json +++ b/apps/oxlint/test/fixtures/load_paths/.oxlintrc.json @@ -1,4 +1,7 @@ { + "categories": { + "correctness": "off" + }, "jsPlugins": [ "./plugins/plugin1.js", "./plugins/plugin2.cjs", @@ -33,6 +36,7 @@ "plugin13/no-debugger": "error", "plugin14/no-debugger": "error", "plugin15/no-debugger": "error", - "plugin16/no-debugger": "error" + "plugin16/no-debugger": "error", + "eslint/no-debugger": "warn" } } diff --git a/apps/oxlint/test/fixtures/load_paths/output.snap.md b/apps/oxlint/test/fixtures/load_paths/output.snap.md index a9dda3b73f903..7f5c7145d23c2 100644 --- a/apps/oxlint/test/fixtures/load_paths/output.snap.md +++ b/apps/oxlint/test/fixtures/load_paths/output.snap.md @@ -107,7 +107,7 @@ `---- Found 1 warning and 16 errors. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 1 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/message_id_error/output.snap.md b/apps/oxlint/test/fixtures/message_id_error/output.snap.md index 02db61caff7d5..1072299442d6e 100644 --- a/apps/oxlint/test/fixtures/message_id_error/output.snap.md +++ b/apps/oxlint/test/fixtures/message_id_error/output.snap.md @@ -9,7 +9,7 @@ | at DebuggerStatement (/plugin.ts:18:21) Found 0 warnings and 1 error. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/message_id_interpolation/output.snap.md b/apps/oxlint/test/fixtures/message_id_interpolation/output.snap.md index cbc8d14e955f7..78c3b75c38cad 100644 --- a/apps/oxlint/test/fixtures/message_id_interpolation/output.snap.md +++ b/apps/oxlint/test/fixtures/message_id_interpolation/output.snap.md @@ -58,7 +58,7 @@ `---- Found 0 warnings and 7 errors. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/message_id_plugin/output.snap.md b/apps/oxlint/test/fixtures/message_id_plugin/output.snap.md index 548baaf1ad925..9a659d5005fee 100644 --- a/apps/oxlint/test/fixtures/message_id_plugin/output.snap.md +++ b/apps/oxlint/test/fixtures/message_id_plugin/output.snap.md @@ -18,7 +18,7 @@ `---- Found 0 warnings and 2 errors. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/message_interpolation/output.snap.md b/apps/oxlint/test/fixtures/message_interpolation/output.snap.md index cbc8d14e955f7..78c3b75c38cad 100644 --- a/apps/oxlint/test/fixtures/message_interpolation/output.snap.md +++ b/apps/oxlint/test/fixtures/message_interpolation/output.snap.md @@ -58,7 +58,7 @@ `---- Found 0 warnings and 7 errors. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/nested_config_duplicate/output.snap.md b/apps/oxlint/test/fixtures/nested_config_duplicate/output.snap.md index 7daf0376edfe4..27cc81fd0abcb 100644 --- a/apps/oxlint/test/fixtures/nested_config_duplicate/output.snap.md +++ b/apps/oxlint/test/fixtures/nested_config_duplicate/output.snap.md @@ -10,7 +10,7 @@ `---- Found 0 warnings and 1 error. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/options/output.snap.md b/apps/oxlint/test/fixtures/options/output.snap.md index 4e9bb14a53964..20f4ddc217bdb 100644 --- a/apps/oxlint/test/fixtures/options/output.snap.md +++ b/apps/oxlint/test/fixtures/options/output.snap.md @@ -268,7 +268,7 @@ `---- Found 0 warnings and 16 errors. -Finished in Xms on 2 files using X threads. +Finished in Xms on 2 files with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/overrides/.oxlintrc.json b/apps/oxlint/test/fixtures/overrides/.oxlintrc.json index 33ec7bf613860..b1102e6065022 100644 --- a/apps/oxlint/test/fixtures/overrides/.oxlintrc.json +++ b/apps/oxlint/test/fixtures/overrides/.oxlintrc.json @@ -1,4 +1,7 @@ { + "categories": { + "correctness": "off" + }, "overrides": [ { "files": ["*.js"], diff --git a/apps/oxlint/test/fixtures/overrides/output.snap.md b/apps/oxlint/test/fixtures/overrides/output.snap.md index 379bbfd6a467f..b98342098c032 100644 --- a/apps/oxlint/test/fixtures/overrides/output.snap.md +++ b/apps/oxlint/test/fixtures/overrides/output.snap.md @@ -9,15 +9,8 @@ : ^^^^^^^^^ `---- - ! ]8;;https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-debugger.html\eslint(no-debugger)]8;;\: `debugger` statement is not allowed - ,-[files/index.js:1:1] - 1 | debugger; - : ^^^^^^^^^ - `---- - help: Remove the debugger statement - -Found 1 warning and 1 error. -Finished in Xms on 1 file using X threads. +Found 0 warnings and 1 error. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/parent/output.snap.md b/apps/oxlint/test/fixtures/parent/output.snap.md index 14c3bab19ae6d..ba8b3297e8f5b 100644 --- a/apps/oxlint/test/fixtures/parent/output.snap.md +++ b/apps/oxlint/test/fixtures/parent/output.snap.md @@ -100,7 +100,7 @@ `---- Found 0 warnings and 12 errors. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/parser_services/output.snap.md b/apps/oxlint/test/fixtures/parser_services/output.snap.md index 82f5ba083142d..d0887152b8fc2 100644 --- a/apps/oxlint/test/fixtures/parser_services/output.snap.md +++ b/apps/oxlint/test/fixtures/parser_services/output.snap.md @@ -11,7 +11,7 @@ `---- Found 0 warnings and 1 error. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/plugin_name/output.snap.md b/apps/oxlint/test/fixtures/plugin_name/output.snap.md index a4e213b9f9360..b5b05f4c108cb 100644 --- a/apps/oxlint/test/fixtures/plugin_name/output.snap.md +++ b/apps/oxlint/test/fixtures/plugin_name/output.snap.md @@ -89,7 +89,7 @@ help: Add `@param` tag with name. Found 0 warnings and 12 errors. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 1 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/scope_manager/output.snap.md b/apps/oxlint/test/fixtures/scope_manager/output.snap.md index cee5f9a5304a5..a5a6d3a3127e0 100644 --- a/apps/oxlint/test/fixtures/scope_manager/output.snap.md +++ b/apps/oxlint/test/fixtures/scope_manager/output.snap.md @@ -87,7 +87,7 @@ `---- Found 0 warnings and 6 errors. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/selector/output.snap.md b/apps/oxlint/test/fixtures/selector/output.snap.md index e1733835fa322..fef0799d756e7 100644 --- a/apps/oxlint/test/fixtures/selector/output.snap.md +++ b/apps/oxlint/test/fixtures/selector/output.snap.md @@ -193,7 +193,7 @@ `---- Found 0 warnings and 1 error. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/sourceCode/output.snap.md b/apps/oxlint/test/fixtures/sourceCode/output.snap.md index ac32ceb354a98..53cb199781d5b 100644 --- a/apps/oxlint/test/fixtures/sourceCode/output.snap.md +++ b/apps/oxlint/test/fixtures/sourceCode/output.snap.md @@ -261,7 +261,7 @@ `---- Found 0 warnings and 16 errors. -Finished in Xms on 2 files using X threads. +Finished in Xms on 2 files with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/sourceCode_late_access/output.snap.md b/apps/oxlint/test/fixtures/sourceCode_late_access/output.snap.md index f70aca31f06f1..2bc315b8554e8 100644 --- a/apps/oxlint/test/fixtures/sourceCode_late_access/output.snap.md +++ b/apps/oxlint/test/fixtures/sourceCode_late_access/output.snap.md @@ -138,7 +138,7 @@ `---- Found 0 warnings and 16 errors. -Finished in Xms on 2 files using X threads. +Finished in Xms on 2 files with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/sourceCode_scope_methods/output.snap.md b/apps/oxlint/test/fixtures/sourceCode_scope_methods/output.snap.md index dbbc2d7d97cbe..93da9659551a6 100644 --- a/apps/oxlint/test/fixtures/sourceCode_scope_methods/output.snap.md +++ b/apps/oxlint/test/fixtures/sourceCode_scope_methods/output.snap.md @@ -292,7 +292,7 @@ `---- Found 0 warnings and 33 errors. -Finished in Xms on 2 files using X threads. +Finished in Xms on 2 files with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/sourceCode_token_methods/output.snap.md b/apps/oxlint/test/fixtures/sourceCode_token_methods/output.snap.md index 8613bd0bae2e6..e45427118a97c 100644 --- a/apps/oxlint/test/fixtures/sourceCode_token_methods/output.snap.md +++ b/apps/oxlint/test/fixtures/sourceCode_token_methods/output.snap.md @@ -422,7 +422,7 @@ `---- Found 0 warnings and 23 errors. -Finished in Xms on 2 files using X threads. +Finished in Xms on 2 files with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/tokens/output.snap.md b/apps/oxlint/test/fixtures/tokens/output.snap.md index f0c84825581cb..7b350304a19be 100644 --- a/apps/oxlint/test/fixtures/tokens/output.snap.md +++ b/apps/oxlint/test/fixtures/tokens/output.snap.md @@ -162,7 +162,7 @@ `---- Found 0 warnings and 16 errors. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/unicode_comments/output.snap.md b/apps/oxlint/test/fixtures/unicode_comments/output.snap.md index 289b36338268f..9a0220fe621b9 100644 --- a/apps/oxlint/test/fixtures/unicode_comments/output.snap.md +++ b/apps/oxlint/test/fixtures/unicode_comments/output.snap.md @@ -129,7 +129,7 @@ `---- Found 0 warnings and 11 errors. -Finished in Xms on 1 file using X threads. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/fixtures/utf16_offsets/.oxlintrc.json b/apps/oxlint/test/fixtures/utf16_offsets/.oxlintrc.json index 40346ec859190..4da02a3aecdf3 100644 --- a/apps/oxlint/test/fixtures/utf16_offsets/.oxlintrc.json +++ b/apps/oxlint/test/fixtures/utf16_offsets/.oxlintrc.json @@ -1,4 +1,7 @@ { + "categories": { + "correctness": "off" + }, "jsPlugins": ["./plugin.ts"], "rules": { "utf16-plugin/no-debugger": "error" diff --git a/apps/oxlint/test/fixtures/utf16_offsets/output.snap.md b/apps/oxlint/test/fixtures/utf16_offsets/output.snap.md index edeef4640c8b2..46b837df61bc8 100644 --- a/apps/oxlint/test/fixtures/utf16_offsets/output.snap.md +++ b/apps/oxlint/test/fixtures/utf16_offsets/output.snap.md @@ -3,14 +3,6 @@ # stdout ``` - ! ]8;;https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-debugger.html\eslint(no-debugger)]8;;\: `debugger` statement is not allowed - ,-[files/index.js:1:1] - 1 | debugger; - : ^^^^^^^^^ - 2 | // £ - `---- - help: Remove the debugger statement - x utf16-plugin(no-debugger): debugger: | start/end: [0,9] | range: [0,9] @@ -35,15 +27,6 @@ 7 | `-> } `---- - ! ]8;;https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-debugger.html\eslint(no-debugger)]8;;\: `debugger` statement is not allowed - ,-[files/index.js:3:1] - 2 | // £ - 3 | debugger; - : ^^^^^^^^^ - 4 | // 🤨 - `---- - help: Remove the debugger statement - x utf16-plugin(no-debugger): debugger: | start/end: [15,24] | range: [15,24] @@ -55,15 +38,6 @@ 4 | // 🤨 `---- - ! ]8;;https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-debugger.html\eslint(no-debugger)]8;;\: `debugger` statement is not allowed - ,-[files/index.js:6:3] - 5 | { - 6 | debugger; - : ^^^^^^^^^ - 7 | } - `---- - help: Remove the debugger statement - x utf16-plugin(no-debugger): debugger: | start/end: [35,44] | range: [35,44] @@ -75,8 +49,8 @@ 7 | } `---- -Found 3 warnings and 4 errors. -Finished in Xms on 1 file using X threads. +Found 0 warnings and 4 errors. +Finished in Xms on 1 file with 0 rules using X threads. ``` # stderr diff --git a/apps/oxlint/test/utils.ts b/apps/oxlint/test/utils.ts index 01651dba626c0..f4711b540a2f7 100644 --- a/apps/oxlint/test/utils.ts +++ b/apps/oxlint/test/utils.ts @@ -202,10 +202,16 @@ function normalizeStdout(stdout: string, fixtureName: string, isESLint: boolean) let lines = stdout.split("\n"); - // Remove timing and thread count info which can vary between runs + // Remove timing and thread count info which can vary between runs. + // + // Examples, all need to be handled: + // `Finished in 123ms on 4 files with 10 rules using 2 threads.` + // `Finished in 1.23s on 1 file using 8 threads.` + // `Finished in 456us on 2 files with 5 rules using 4 threads.` lines[lines.length - 1] = lines[lines.length - 1].replace( - /^Finished in \d+(?:\.\d+)?(?:s|ms|us|ns) on (\d+) file(s?) using \d+ threads.$/, - "Finished in Xms on $1 file$2 using X threads.", + /^Finished in \d+(?:\.\d+)?(?:s|ms|us|ns) on (\d+) file(s?) (?:with (\d+) rule(?:s?) )?using \d+ threads.$/, + (_match, filesCount, filePlural, rulesCount) => + `Finished in Xms on ${filesCount} file${filePlural}${rulesCount ? ` with ${rulesCount} rules` : ""} using X threads.`, ); // Remove lines from stack traces which are outside `fixtures` directory. diff --git a/crates/oxc_linter/src/config/config_store.rs b/crates/oxc_linter/src/config/config_store.rs index 2f06c7a6bd550..97a430d5d2c10 100644 --- a/crates/oxc_linter/src/config/config_store.rs +++ b/crates/oxc_linter/src/config/config_store.rs @@ -297,7 +297,8 @@ impl ConfigStore { /// Returns the number of rules, optionally filtering out tsgolint rules if type_aware_enabled is false. pub fn number_of_rules(&self, type_aware_enabled: bool) -> Option { - if !self.nested_configs.is_empty() { + // This includes the base config for now, so 1 is fine :) Reference: https://github.com/oxc-project/oxc/issues/16356 + if self.nested_configs.len() > 1 { return None; } let count = if type_aware_enabled { @@ -1018,34 +1019,29 @@ mod test { let base_rules = vec![ (RuleEnum::EslintCurly(EslintCurly::default()), AllowWarnDeny::Deny), ( + // This is a type-aware, tsgolint rule RuleEnum::TypescriptNoMisusedPromises(TypescriptNoMisusedPromises::default()), AllowWarnDeny::Deny, ), ]; - let store = ConfigStore::new( - Config::new( - base_rules.clone(), - vec![], - OxlintCategories::default(), - base_config.clone(), - ResolvedOxlintOverrides::new(vec![]), - ), - FxHashMap::default(), - ExternalPluginStore::default(), + let base = Config::new( + base_rules.clone(), + vec![], + OxlintCategories::default(), + base_config.clone(), + ResolvedOxlintOverrides::new(vec![]), ); + let store = + ConfigStore::new(base.clone(), FxHashMap::default(), ExternalPluginStore::default()); + let mut nested_configs = FxHashMap::default(); - nested_configs.insert( - PathBuf::new(), - Config::new( - vec![], - vec![], - OxlintCategories::default(), - base_config.clone(), - ResolvedOxlintOverrides::new(vec![]), - ), - ); + // Add the base config to nested_configs, as that's how it actually works right now. + // TODO: Can remove this addition of the base config when we fix https://github.com/oxc-project/oxc/issues/16356 + nested_configs.insert(PathBuf::new(), base.clone()); + // Then add another so we have more than just the base config here. + nested_configs.insert(PathBuf::from("nested"), base); let store_with_nested_configs = ConfigStore::new( Config::new( @@ -1059,8 +1055,10 @@ mod test { ExternalPluginStore::default(), ); + // Should return only 1 rule when type-aware is disabled, and 2 when it's enabled. assert_eq!(store.number_of_rules(false), Some(1)); assert_eq!(store.number_of_rules(true), Some(2)); + // Should return None when there are nested configs. assert_eq!(store_with_nested_configs.number_of_rules(false), None); assert_eq!(store_with_nested_configs.number_of_rules(true), None); }