diff --git a/crates/oxc_linter/src/disable_directives.rs b/crates/oxc_linter/src/disable_directives.rs index 20c92011a9054..32b6173e527c9 100644 --- a/crates/oxc_linter/src/disable_directives.rs +++ b/crates/oxc_linter/src/disable_directives.rs @@ -599,7 +599,7 @@ semi*/ ), ]; - Tester::new(EslintNoDebugger::NAME, EslintNoDebugger::CATEGORY, pass, fail) + Tester::new(EslintNoDebugger::NAME, EslintNoDebugger::PLUGIN, pass, fail) .intentionally_allow_no_fix_tests() .test(); } diff --git a/crates/oxc_linter/src/rule.rs b/crates/oxc_linter/src/rule.rs index 12529b150293a..49e895662034c 100644 --- a/crates/oxc_linter/src/rule.rs +++ b/crates/oxc_linter/src/rule.rs @@ -65,6 +65,8 @@ pub trait Rule: Sized + Default + fmt::Debug { pub trait RuleMeta { const NAME: &'static str; + const PLUGIN: &'static str; + const CATEGORY: RuleCategory; /// What kind of auto-fixing can this rule do? diff --git a/crates/oxc_linter/src/rules/eslint/array_callback_return/mod.rs b/crates/oxc_linter/src/rules/eslint/array_callback_return/mod.rs index 21e05f8b12cc6..db4b45f8d3b04 100644 --- a/crates/oxc_linter/src/rules/eslint/array_callback_return/mod.rs +++ b/crates/oxc_linter/src/rules/eslint/array_callback_return/mod.rs @@ -60,6 +60,7 @@ declare_oxc_lint!( /// }); /// ``` ArrayCallbackReturn, + eslint, pedantic ); @@ -580,6 +581,6 @@ fn test() { ("foo?.filter((function() { return () => { console.log('hello') } })?.())", None), ]; - Tester::new(ArrayCallbackReturn::NAME, ArrayCallbackReturn::CATEGORY, pass, fail) + Tester::new(ArrayCallbackReturn::NAME, ArrayCallbackReturn::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/constructor_super.rs b/crates/oxc_linter/src/rules/eslint/constructor_super.rs index 14965d1992f12..56c4492719e6a 100644 --- a/crates/oxc_linter/src/rules/eslint/constructor_super.rs +++ b/crates/oxc_linter/src/rules/eslint/constructor_super.rs @@ -33,6 +33,7 @@ declare_oxc_lint!( /// } /// ``` ConstructorSuper, + eslint, nursery // This rule should be implemented with CFG, the current implementation has a lot of // false positives. ); @@ -71,5 +72,5 @@ fn test() { // ("class A extends 'test' { constructor() { super(); } }", None), ]; - Tester::new(ConstructorSuper::NAME, ConstructorSuper::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(ConstructorSuper::NAME, ConstructorSuper::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/default_case.rs b/crates/oxc_linter/src/rules/eslint/default_case.rs index 3f13aed6cae3e..1e1861d734dca 100644 --- a/crates/oxc_linter/src/rules/eslint/default_case.rs +++ b/crates/oxc_linter/src/rules/eslint/default_case.rs @@ -46,6 +46,7 @@ declare_oxc_lint!( /// } /// ``` DefaultCase, + eslint, restriction, ); @@ -255,5 +256,5 @@ fn test() { ), ]; - Tester::new(DefaultCase::NAME, DefaultCase::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(DefaultCase::NAME, DefaultCase::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/default_case_last.rs b/crates/oxc_linter/src/rules/eslint/default_case_last.rs index b0cbf40005092..d870e416778d2 100644 --- a/crates/oxc_linter/src/rules/eslint/default_case_last.rs +++ b/crates/oxc_linter/src/rules/eslint/default_case_last.rs @@ -47,6 +47,7 @@ declare_oxc_lint!( /// } /// ``` DefaultCaseLast, + eslint, style ); @@ -117,5 +118,5 @@ fn test() { r"switch (foo) { case 1: default: case 2: }", ]; - Tester::new(DefaultCaseLast::NAME, DefaultCaseLast::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(DefaultCaseLast::NAME, DefaultCaseLast::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/default_param_last.rs b/crates/oxc_linter/src/rules/eslint/default_param_last.rs index 05cef46aa1bd6..cdc32fc9dbab3 100644 --- a/crates/oxc_linter/src/rules/eslint/default_param_last.rs +++ b/crates/oxc_linter/src/rules/eslint/default_param_last.rs @@ -32,6 +32,7 @@ declare_oxc_lint!( /// createUser(undefined, "tabby") /// ``` DefaultParamLast, + eslint, style ); @@ -97,5 +98,5 @@ fn test() { "const f = ([a, b] = [1, 2], c) => {}", ]; - Tester::new(DefaultParamLast::NAME, DefaultParamLast::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(DefaultParamLast::NAME, DefaultParamLast::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/eqeqeq.rs b/crates/oxc_linter/src/rules/eslint/eqeqeq.rs index 174ea12b6c53d..49c40cb0de08f 100644 --- a/crates/oxc_linter/src/rules/eslint/eqeqeq.rs +++ b/crates/oxc_linter/src/rules/eslint/eqeqeq.rs @@ -35,6 +35,7 @@ declare_oxc_lint!( /// a == b /// ``` Eqeqeq, + eslint, pedantic, conditional_fix ); @@ -253,5 +254,5 @@ fn test() { ("a == b", "a == b", None), ]; - Tester::new(Eqeqeq::NAME, Eqeqeq::CATEGORY, pass, fail).expect_fix(fix).test_and_snapshot(); + Tester::new(Eqeqeq::NAME, Eqeqeq::PLUGIN, pass, fail).expect_fix(fix).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/for_direction.rs b/crates/oxc_linter/src/rules/eslint/for_direction.rs index 9bbe7b1c05f8f..ffd251f9bc5b5 100644 --- a/crates/oxc_linter/src/rules/eslint/for_direction.rs +++ b/crates/oxc_linter/src/rules/eslint/for_direction.rs @@ -77,6 +77,7 @@ declare_oxc_lint!( /// } /// ``` ForDirection, + eslint, correctness, fix_dangerous ); @@ -320,7 +321,7 @@ fn test() { ("for(var ii = 10; ii > 0; ii+=1){}", "for(var ii = 10; ii > 0; ii-=1){}", None), ]; - Tester::new(ForDirection::NAME, ForDirection::CATEGORY, pass, fail) + Tester::new(ForDirection::NAME, ForDirection::PLUGIN, pass, fail) .expect_fix(fix) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/func_names.rs b/crates/oxc_linter/src/rules/eslint/func_names.rs index ad54b56c06e38..5cf5f5d75b197 100644 --- a/crates/oxc_linter/src/rules/eslint/func_names.rs +++ b/crates/oxc_linter/src/rules/eslint/func_names.rs @@ -141,6 +141,7 @@ declare_oxc_lint!( /// Foo.prototype.bar = function() {}; /// ``` FuncNames, + eslint, style, conditional_fix_suggestion ); @@ -798,7 +799,5 @@ fn test() { ), ]; - Tester::new(FuncNames::NAME, FuncNames::CATEGORY, pass, fail) - .expect_fix(fix) - .test_and_snapshot(); + Tester::new(FuncNames::NAME, FuncNames::PLUGIN, pass, fail).expect_fix(fix).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/getter_return.rs b/crates/oxc_linter/src/rules/eslint/getter_return.rs index 044ee94ecda69..3d02f2cb19cc3 100644 --- a/crates/oxc_linter/src/rules/eslint/getter_return.rs +++ b/crates/oxc_linter/src/rules/eslint/getter_return.rs @@ -77,6 +77,7 @@ declare_oxc_lint!( /// } /// ``` GetterReturn, + eslint, nursery ); @@ -519,7 +520,7 @@ fn test() { ), ]; - Tester::new(GetterReturn::NAME, GetterReturn::CATEGORY, pass, fail) + Tester::new(GetterReturn::NAME, GetterReturn::PLUGIN, pass, fail) .change_rule_path_extension("js") .test_and_snapshot(); @@ -537,5 +538,5 @@ fn test() { let fail = vec![]; - Tester::new(GetterReturn::NAME, GetterReturn::CATEGORY, pass, fail).test(); + Tester::new(GetterReturn::NAME, GetterReturn::PLUGIN, pass, fail).test(); } diff --git a/crates/oxc_linter/src/rules/eslint/guard_for_in.rs b/crates/oxc_linter/src/rules/eslint/guard_for_in.rs index 83ec3eec71b5e..8608e80747de0 100644 --- a/crates/oxc_linter/src/rules/eslint/guard_for_in.rs +++ b/crates/oxc_linter/src/rules/eslint/guard_for_in.rs @@ -28,6 +28,7 @@ declare_oxc_lint!( /// } /// ``` GuardForIn, + eslint, style ); @@ -93,5 +94,5 @@ fn test() { "for (var x in o) foo();", ]; - Tester::new(GuardForIn::NAME, GuardForIn::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(GuardForIn::NAME, GuardForIn::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/max_classes_per_file.rs b/crates/oxc_linter/src/rules/eslint/max_classes_per_file.rs index 27ae72ae92946..1c8a70821bda1 100644 --- a/crates/oxc_linter/src/rules/eslint/max_classes_per_file.rs +++ b/crates/oxc_linter/src/rules/eslint/max_classes_per_file.rs @@ -52,6 +52,7 @@ declare_oxc_lint!( /// class Bar {} /// ``` MaxClassesPerFile, + eslint, pedantic, ); @@ -188,6 +189,5 @@ fn test() { ), ]; - Tester::new(MaxClassesPerFile::NAME, MaxClassesPerFile::CATEGORY, pass, fail) - .test_and_snapshot(); + Tester::new(MaxClassesPerFile::NAME, MaxClassesPerFile::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/max_lines.rs b/crates/oxc_linter/src/rules/eslint/max_lines.rs index ab8885d84f506..17ffac1125ac0 100644 --- a/crates/oxc_linter/src/rules/eslint/max_lines.rs +++ b/crates/oxc_linter/src/rules/eslint/max_lines.rs @@ -47,6 +47,7 @@ declare_oxc_lint!( /// file, most people would agree it should not be in the thousands. /// Recommendations usually range from 100 to 500 lines. MaxLines, + eslint, pedantic ); @@ -420,5 +421,5 @@ fn test() { ), ]; - Tester::new(MaxLines::NAME, MaxLines::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(MaxLines::NAME, MaxLines::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/max_params.rs b/crates/oxc_linter/src/rules/eslint/max_params.rs index 0bc971f357fbb..76c4d159e0f7b 100644 --- a/crates/oxc_linter/src/rules/eslint/max_params.rs +++ b/crates/oxc_linter/src/rules/eslint/max_params.rs @@ -50,6 +50,7 @@ declare_oxc_lint!( /// } /// ``` MaxParams, + eslint, style ); @@ -157,5 +158,5 @@ fn test() { ), ]; - Tester::new(MaxParams::NAME, MaxParams::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(MaxParams::NAME, MaxParams::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/new_cap.rs b/crates/oxc_linter/src/rules/eslint/new_cap.rs index d1283782c0d32..7e71d1079de47 100644 --- a/crates/oxc_linter/src/rules/eslint/new_cap.rs +++ b/crates/oxc_linter/src/rules/eslint/new_cap.rs @@ -442,6 +442,7 @@ declare_oxc_lint!( /// var friend = new person.acquaintance(); /// ``` NewCap, + eslint, style, pending // TODO: maybe? ); @@ -785,5 +786,5 @@ fn test() { ("(foo?.Bar)();", None), // { "ecmaVersion": 2020 } ]; - Tester::new(NewCap::NAME, NewCap::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NewCap::NAME, NewCap::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_alert.rs b/crates/oxc_linter/src/rules/eslint/no_alert.rs index abcf9ffeeb39b..f52cb9afdac54 100644 --- a/crates/oxc_linter/src/rules/eslint/no_alert.rs +++ b/crates/oxc_linter/src/rules/eslint/no_alert.rs @@ -49,6 +49,7 @@ declare_oxc_lint!( /// } /// ``` NoAlert, + eslint, restriction, ); @@ -175,5 +176,5 @@ fn test() { "(window?.alert)(foo)", // { "ecmaVersion": 2020 } ]; - Tester::new(NoAlert::NAME, NoAlert::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoAlert::NAME, NoAlert::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_array_constructor.rs b/crates/oxc_linter/src/rules/eslint/no_array_constructor.rs index f987a471ce58f..970d178b05e36 100644 --- a/crates/oxc_linter/src/rules/eslint/no_array_constructor.rs +++ b/crates/oxc_linter/src/rules/eslint/no_array_constructor.rs @@ -42,6 +42,7 @@ declare_oxc_lint!( /// let arr3 = new Array(9); /// ``` NoArrayConstructor, + eslint, pedantic, pending ); @@ -124,6 +125,6 @@ fn test() { ("Array(0, 1, 2)", None), ]; - Tester::new(NoArrayConstructor::NAME, NoArrayConstructor::CATEGORY, pass, fail) + Tester::new(NoArrayConstructor::NAME, NoArrayConstructor::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_async_promise_executor.rs b/crates/oxc_linter/src/rules/eslint/no_async_promise_executor.rs index 71bcc2607fdb6..5ec7a30b45f42 100644 --- a/crates/oxc_linter/src/rules/eslint/no_async_promise_executor.rs +++ b/crates/oxc_linter/src/rules/eslint/no_async_promise_executor.rs @@ -42,6 +42,7 @@ declare_oxc_lint!( /// - If an async executor function throws an error, the error will be lost and won’t cause the newly-constructed `Promise` to reject.This could make it difficult to debug and handle some errors. /// - If a Promise executor function is using `await`, this is usually a sign that it is not actually necessary to use the `new Promise` constructor, or the scope of the `new Promise` constructor can be reduced. NoAsyncPromiseExecutor, + eslint, correctness ); @@ -85,6 +86,6 @@ fn test() { ("new Promise(((((async () => {})))))", None), ]; - Tester::new(NoAsyncPromiseExecutor::NAME, NoAsyncPromiseExecutor::CATEGORY, pass, fail) + Tester::new(NoAsyncPromiseExecutor::NAME, NoAsyncPromiseExecutor::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_await_in_loop.rs b/crates/oxc_linter/src/rules/eslint/no_await_in_loop.rs index 90810c4b56c04..637fae4656974 100644 --- a/crates/oxc_linter/src/rules/eslint/no_await_in_loop.rs +++ b/crates/oxc_linter/src/rules/eslint/no_await_in_loop.rs @@ -43,6 +43,7 @@ declare_oxc_lint!( /// } /// ``` NoAwaitInLoop, + eslint, perf ); @@ -232,5 +233,5 @@ fn test() { "async function foo() { for await (var x of xs) { while (1) await f(x) } }", ]; - Tester::new(NoAwaitInLoop::NAME, NoAwaitInLoop::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoAwaitInLoop::NAME, NoAwaitInLoop::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_bitwise.rs b/crates/oxc_linter/src/rules/eslint/no_bitwise.rs index 186d4e80f3cff..dd80930b93d62 100644 --- a/crates/oxc_linter/src/rules/eslint/no_bitwise.rs +++ b/crates/oxc_linter/src/rules/eslint/no_bitwise.rs @@ -45,6 +45,7 @@ declare_oxc_lint!( /// var x = y | z; /// ``` NoBitwise, + eslint, restriction ); @@ -158,5 +159,5 @@ fn test() { ("a >>>= b", None), ]; - Tester::new(NoBitwise::NAME, NoBitwise::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoBitwise::NAME, NoBitwise::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_caller.rs b/crates/oxc_linter/src/rules/eslint/no_caller.rs index 43ae186d9dfda..d2928dc0e1c03 100644 --- a/crates/oxc_linter/src/rules/eslint/no_caller.rs +++ b/crates/oxc_linter/src/rules/eslint/no_caller.rs @@ -68,6 +68,7 @@ declare_oxc_lint!( /// }); /// ``` NoCaller, + eslint, correctness ); @@ -98,5 +99,5 @@ fn test() { let fail = vec![("var x = arguments.callee", None), ("var x = arguments.caller", None)]; - Tester::new(NoCaller::NAME, NoCaller::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoCaller::NAME, NoCaller::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_case_declarations.rs b/crates/oxc_linter/src/rules/eslint/no_case_declarations.rs index 7d80c6b7491b9..3ba7bc21ed4bc 100644 --- a/crates/oxc_linter/src/rules/eslint/no_case_declarations.rs +++ b/crates/oxc_linter/src/rules/eslint/no_case_declarations.rs @@ -41,6 +41,7 @@ declare_oxc_lint!( /// } /// ``` NoCaseDeclarations, + eslint, pedantic ); @@ -103,6 +104,6 @@ fn test() { ("switch (a) { default: class C {} break; }", None), ]; - Tester::new(NoCaseDeclarations::NAME, NoCaseDeclarations::CATEGORY, pass, fail) + Tester::new(NoCaseDeclarations::NAME, NoCaseDeclarations::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_class_assign.rs b/crates/oxc_linter/src/rules/eslint/no_class_assign.rs index 05869327bd99c..527d8890c81cd 100644 --- a/crates/oxc_linter/src/rules/eslint/no_class_assign.rs +++ b/crates/oxc_linter/src/rules/eslint/no_class_assign.rs @@ -30,6 +30,7 @@ declare_oxc_lint!( /// let a = new A() // Error /// ``` NoClassAssign, + eslint, correctness ); @@ -84,5 +85,5 @@ fn test() { ("if (foo) { class A {} A = 1; }", None), ]; - Tester::new(NoClassAssign::NAME, NoClassAssign::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoClassAssign::NAME, NoClassAssign::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_compare_neg_zero.rs b/crates/oxc_linter/src/rules/eslint/no_compare_neg_zero.rs index d8d7b2912ea90..e339232b7d9da 100644 --- a/crates/oxc_linter/src/rules/eslint/no_compare_neg_zero.rs +++ b/crates/oxc_linter/src/rules/eslint/no_compare_neg_zero.rs @@ -29,6 +29,7 @@ declare_oxc_lint!( /// if (x === -0) {} /// ``` NoCompareNegZero, + eslint, correctness, conditional_fix_suggestion ); @@ -167,7 +168,7 @@ fn test() { ("-0n <= x", "0n <= x", None), ]; - Tester::new(NoCompareNegZero::NAME, NoCompareNegZero::CATEGORY, pass, fail) + Tester::new(NoCompareNegZero::NAME, NoCompareNegZero::PLUGIN, pass, fail) .expect_fix(fix) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_cond_assign.rs b/crates/oxc_linter/src/rules/eslint/no_cond_assign.rs index 2f9c65f37e1db..f865c29d418a2 100644 --- a/crates/oxc_linter/src/rules/eslint/no_cond_assign.rs +++ b/crates/oxc_linter/src/rules/eslint/no_cond_assign.rs @@ -49,6 +49,7 @@ declare_oxc_lint!( /// } /// ``` NoCondAssign, + eslint, correctness ); @@ -250,5 +251,5 @@ fn test() { ("(((3496.29)).bkufyydt = 2e308) ? foo : bar;", None), ]; - Tester::new(NoCondAssign::NAME, NoCondAssign::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoCondAssign::NAME, NoCondAssign::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_console.rs b/crates/oxc_linter/src/rules/eslint/no_console.rs index 63366aa322e87..23aba3b238524 100644 --- a/crates/oxc_linter/src/rules/eslint/no_console.rs +++ b/crates/oxc_linter/src/rules/eslint/no_console.rs @@ -54,6 +54,7 @@ declare_oxc_lint!( /// console.log('here'); /// ``` NoConsole, + eslint, restriction, suggestion ); @@ -187,7 +188,5 @@ fn test() { ("const x = { foo: console.log(bar) }", "const x = { foo: undefined }", None), ]; - Tester::new(NoConsole::NAME, NoConsole::CATEGORY, pass, fail) - .expect_fix(fix) - .test_and_snapshot(); + Tester::new(NoConsole::NAME, NoConsole::PLUGIN, pass, fail).expect_fix(fix).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_const_assign.rs b/crates/oxc_linter/src/rules/eslint/no_const_assign.rs index 9d9a1f1d8d68a..03990576f51d7 100644 --- a/crates/oxc_linter/src/rules/eslint/no_const_assign.rs +++ b/crates/oxc_linter/src/rules/eslint/no_const_assign.rs @@ -46,6 +46,7 @@ declare_oxc_lint!( /// b += 1; /// ``` NoConstAssign, + eslint, correctness ); @@ -109,5 +110,5 @@ fn test() { ("const b = 0; ({a, ...b} = {a: 1, c: 2, d: 3})", None), ]; - Tester::new(NoConstAssign::NAME, NoConstAssign::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoConstAssign::NAME, NoConstAssign::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_constant_binary_expression.rs b/crates/oxc_linter/src/rules/eslint/no_constant_binary_expression.rs index e54a380f213f0..5ff70787dc521 100644 --- a/crates/oxc_linter/src/rules/eslint/no_constant_binary_expression.rs +++ b/crates/oxc_linter/src/rules/eslint/no_constant_binary_expression.rs @@ -44,6 +44,7 @@ declare_oxc_lint!( /// // However, this will always result in `isEmpty` being `false`. /// ``` NoConstantBinaryExpression, + eslint, correctness ); @@ -654,6 +655,6 @@ fn test() { ("window.abc ?? 'non-nullish' ?? anything", None), ]; - Tester::new(NoConstantBinaryExpression::NAME, NoConstantBinaryExpression::CATEGORY, pass, fail) + Tester::new(NoConstantBinaryExpression::NAME, NoConstantBinaryExpression::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_constant_condition.rs b/crates/oxc_linter/src/rules/eslint/no_constant_condition.rs index a7af4da20c40a..691b1f02adfc8 100644 --- a/crates/oxc_linter/src/rules/eslint/no_constant_condition.rs +++ b/crates/oxc_linter/src/rules/eslint/no_constant_condition.rs @@ -63,6 +63,7 @@ declare_oxc_lint!( /// } /// ``` NoConstantCondition, + eslint, correctness ); @@ -405,6 +406,6 @@ fn test() { // ("function* foo() { for (let foo = 1 + 2 + 3 + (yield); true; baz) {}}", None), ]; - Tester::new(NoConstantCondition::NAME, NoConstantCondition::CATEGORY, pass, fail) + Tester::new(NoConstantCondition::NAME, NoConstantCondition::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_constructor_return.rs b/crates/oxc_linter/src/rules/eslint/no_constructor_return.rs index 85cb36ec2980f..166aa2f4217a1 100644 --- a/crates/oxc_linter/src/rules/eslint/no_constructor_return.rs +++ b/crates/oxc_linter/src/rules/eslint/no_constructor_return.rs @@ -42,6 +42,7 @@ declare_oxc_lint!( /// } /// ``` NoConstructorReturn, + eslint, pedantic ); @@ -104,6 +105,6 @@ fn test() { "class C { constructor(a) { if (!a) { return '' } else { a() } } }", ]; - Tester::new(NoConstructorReturn::NAME, NoConstructorReturn::CATEGORY, pass, fail) + Tester::new(NoConstructorReturn::NAME, NoConstructorReturn::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_continue.rs b/crates/oxc_linter/src/rules/eslint/no_continue.rs index 74e3085998fb0..97e3eb6ed73e4 100644 --- a/crates/oxc_linter/src/rules/eslint/no_continue.rs +++ b/crates/oxc_linter/src/rules/eslint/no_continue.rs @@ -35,6 +35,7 @@ declare_oxc_lint!( /// } /// ``` NoContinue, + eslint, style ); @@ -65,5 +66,5 @@ fn test() { "var sum = 0, i = 0; myLabel: while(i < 10) { if(i <= 5) { i++; continue myLabel; } sum += i; i++; }", ]; - Tester::new(NoContinue::NAME, NoContinue::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoContinue::NAME, NoContinue::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_control_regex.rs b/crates/oxc_linter/src/rules/eslint/no_control_regex.rs index b79adf726a4ed..74697f2129bc3 100644 --- a/crates/oxc_linter/src/rules/eslint/no_control_regex.rs +++ b/crates/oxc_linter/src/rules/eslint/no_control_regex.rs @@ -66,6 +66,7 @@ declare_oxc_lint!( /// var pattern8 = new RegExp("\\n"); /// ``` NoControlRegex, + eslint, correctness ); @@ -212,7 +213,7 @@ mod tests { fn test_hex_literals() { Tester::new( NoControlRegex::NAME, - NoControlRegex::CATEGORY, + NoControlRegex::PLUGIN, vec![ "x1f", // not a control sequence r"new RegExp('\x20')", // control sequence in valid range @@ -228,7 +229,7 @@ mod tests { fn test_unicode_literals() { Tester::new( NoControlRegex::NAME, - NoControlRegex::CATEGORY, + NoControlRegex::PLUGIN, vec![ r"u00", // not a control sequence r"\u00ff", // in valid range @@ -260,7 +261,7 @@ mod tests { fn test_unicode_brackets() { Tester::new( NoControlRegex::NAME, - NoControlRegex::CATEGORY, + NoControlRegex::PLUGIN, vec![ r"let r = /\u{0}/", // no unicode flag, this is valid r"let r = /\u{ff}/u", @@ -292,7 +293,7 @@ mod tests { r"const r = /([a-z])\2/;", r"const r = /([a-z])\0/;", ]; - Tester::new(NoControlRegex::NAME, NoControlRegex::CATEGORY, pass, fail) + Tester::new(NoControlRegex::NAME, NoControlRegex::PLUGIN, pass, fail) .with_snapshot_suffix("capture-group-indexing") .test_and_snapshot(); } @@ -303,7 +304,7 @@ mod tests { // https://github.com/eslint/eslint/blob/v9.9.1/tests/lib/rules/no-control-regex.js Tester::new( NoControlRegex::NAME, - NoControlRegex::CATEGORY, + NoControlRegex::PLUGIN, vec![ "var regex = /x1f/;", r"var regex = /\\x1f/", diff --git a/crates/oxc_linter/src/rules/eslint/no_debugger.rs b/crates/oxc_linter/src/rules/eslint/no_debugger.rs index 1fd4f75056fd8..532561862dd9f 100644 --- a/crates/oxc_linter/src/rules/eslint/no_debugger.rs +++ b/crates/oxc_linter/src/rules/eslint/no_debugger.rs @@ -30,6 +30,7 @@ declare_oxc_lint!( /// } /// ``` NoDebugger, + eslint, correctness, fix ); @@ -81,7 +82,7 @@ fn test() { ("if (foo) { debugger }", "if (foo) { }", None), ]; - Tester::new(NoDebugger::NAME, NoDebugger::CATEGORY, pass, fail) + Tester::new(NoDebugger::NAME, NoDebugger::PLUGIN, pass, fail) .expect_fix(fix) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_delete_var.rs b/crates/oxc_linter/src/rules/eslint/no_delete_var.rs index 2493db5d31a54..c355a23a908b1 100644 --- a/crates/oxc_linter/src/rules/eslint/no_delete_var.rs +++ b/crates/oxc_linter/src/rules/eslint/no_delete_var.rs @@ -32,6 +32,7 @@ declare_oxc_lint!( /// delete x; /// ``` NoDeleteVar, + eslint, correctness ); @@ -54,5 +55,5 @@ fn test() { let fail = vec![("delete x", None)]; - Tester::new(NoDeleteVar::NAME, NoDeleteVar::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoDeleteVar::NAME, NoDeleteVar::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_div_regex.rs b/crates/oxc_linter/src/rules/eslint/no_div_regex.rs index d69edc0552113..d8839af7b125f 100644 --- a/crates/oxc_linter/src/rules/eslint/no_div_regex.rs +++ b/crates/oxc_linter/src/rules/eslint/no_div_regex.rs @@ -30,6 +30,7 @@ declare_oxc_lint!( /// function bar() { return /=foo/; } /// ``` NoDivRegex, + eslint, restriction, fix ); @@ -71,7 +72,7 @@ fn test() { None, )]; - Tester::new(NoDivRegex::NAME, NoDivRegex::CATEGORY, pass, fail) + Tester::new(NoDivRegex::NAME, NoDivRegex::PLUGIN, pass, fail) .expect_fix(fix) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_dupe_class_members.rs b/crates/oxc_linter/src/rules/eslint/no_dupe_class_members.rs index c9118a247b504..82c7e34299f28 100644 --- a/crates/oxc_linter/src/rules/eslint/no_dupe_class_members.rs +++ b/crates/oxc_linter/src/rules/eslint/no_dupe_class_members.rs @@ -39,6 +39,7 @@ declare_oxc_lint!( /// a.foo() // Uncaught TypeError: a.foo is not a function /// ``` NoDupeClassMembers, + eslint, correctness ); @@ -164,6 +165,6 @@ fn test() { "class A { foo; foo() {}}", ]; - Tester::new(NoDupeClassMembers::NAME, NoDupeClassMembers::CATEGORY, pass, fail) + Tester::new(NoDupeClassMembers::NAME, NoDupeClassMembers::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_dupe_else_if.rs b/crates/oxc_linter/src/rules/eslint/no_dupe_else_if.rs index 002f4020739d8..455129f8db93f 100644 --- a/crates/oxc_linter/src/rules/eslint/no_dupe_else_if.rs +++ b/crates/oxc_linter/src/rules/eslint/no_dupe_else_if.rs @@ -41,6 +41,7 @@ declare_oxc_lint!( /// } /// ``` NoDupeElseIf, + eslint, correctness ); @@ -257,5 +258,5 @@ fn test() { ("if (a && a) {} else if (a) {}", None), ]; - Tester::new(NoDupeElseIf::NAME, NoDupeElseIf::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoDupeElseIf::NAME, NoDupeElseIf::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_dupe_keys.rs b/crates/oxc_linter/src/rules/eslint/no_dupe_keys.rs index 62c6160717fd4..4db0d44431fd0 100644 --- a/crates/oxc_linter/src/rules/eslint/no_dupe_keys.rs +++ b/crates/oxc_linter/src/rules/eslint/no_dupe_keys.rs @@ -62,6 +62,7 @@ declare_oxc_lint!( /// }; /// ``` NoDupeKeys, + eslint, correctness ); @@ -149,5 +150,5 @@ fn test() { ("var x = ({ '/(?0)/': 1, [/(?0)/]: 2 })", None), ]; - Tester::new(NoDupeKeys::NAME, NoDupeKeys::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoDupeKeys::NAME, NoDupeKeys::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_duplicate_case.rs b/crates/oxc_linter/src/rules/eslint/no_duplicate_case.rs index a8cab886c8125..1de99a9495385 100644 --- a/crates/oxc_linter/src/rules/eslint/no_duplicate_case.rs +++ b/crates/oxc_linter/src/rules/eslint/no_duplicate_case.rs @@ -75,6 +75,7 @@ declare_oxc_lint!( /// } /// ``` NoDuplicateCase, + eslint, correctness ); @@ -133,5 +134,5 @@ fn test() { "var a = 1, f = function(s) { return { p1: s } }; switch (a) {case f(\na + 1 // comment\n).p1: break; case f(a+1)\n.p1: break; default: break;}", ]; - Tester::new(NoDuplicateCase::NAME, NoDuplicateCase::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoDuplicateCase::NAME, NoDuplicateCase::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_duplicate_imports.rs b/crates/oxc_linter/src/rules/eslint/no_duplicate_imports.rs index 69a994d34520a..11d79468aa0f7 100644 --- a/crates/oxc_linter/src/rules/eslint/no_duplicate_imports.rs +++ b/crates/oxc_linter/src/rules/eslint/no_duplicate_imports.rs @@ -55,6 +55,7 @@ declare_oxc_lint!( /// import something from 'another-module'; /// ``` NoDuplicateImports, + eslint, style, pending); @@ -470,6 +471,6 @@ fn test() { ), ]; - Tester::new(NoDuplicateImports::NAME, NoDuplicateImports::CATEGORY, pass, fail) + Tester::new(NoDuplicateImports::NAME, NoDuplicateImports::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_else_return.rs b/crates/oxc_linter/src/rules/eslint/no_else_return.rs index 0490c4c66fb46..1ee55a2133b77 100644 --- a/crates/oxc_linter/src/rules/eslint/no_else_return.rs +++ b/crates/oxc_linter/src/rules/eslint/no_else_return.rs @@ -162,6 +162,7 @@ declare_oxc_lint!( /// } /// ``` NoElseReturn, + eslint, pedantic, conditional_fix ); @@ -833,7 +834,7 @@ fn test() { ), ("if (foo) { return true; } else { let a; }", "if (foo) { return true; } let a;", None), ]; - Tester::new(NoElseReturn::NAME, NoElseReturn::CATEGORY, pass, fail) + Tester::new(NoElseReturn::NAME, NoElseReturn::PLUGIN, pass, fail) .expect_fix(fix) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_empty.rs b/crates/oxc_linter/src/rules/eslint/no_empty.rs index d59c6e94bec0e..1201304e6abda 100644 --- a/crates/oxc_linter/src/rules/eslint/no_empty.rs +++ b/crates/oxc_linter/src/rules/eslint/no_empty.rs @@ -31,6 +31,7 @@ declare_oxc_lint!( /// } /// ``` NoEmpty, + eslint, restriction, suggestion ); @@ -196,5 +197,5 @@ fn test() { ("try { foo(); } catch (ex) {} finally {}", "try { foo(); } catch (ex) {} ", None), ]; - Tester::new(NoEmpty::NAME, NoEmpty::CATEGORY, pass, fail).expect_fix(fix).test_and_snapshot(); + Tester::new(NoEmpty::NAME, NoEmpty::PLUGIN, pass, fail).expect_fix(fix).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_empty_character_class.rs b/crates/oxc_linter/src/rules/eslint/no_empty_character_class.rs index 9c30cf6bfba91..9c8e4bc823e0e 100644 --- a/crates/oxc_linter/src/rules/eslint/no_empty_character_class.rs +++ b/crates/oxc_linter/src/rules/eslint/no_empty_character_class.rs @@ -32,6 +32,7 @@ declare_oxc_lint!( /// var foo = /^abc[]/; /// ``` NoEmptyCharacterClass, + eslint, correctness ); @@ -126,6 +127,6 @@ fn test() { ("var foo = /[[]&&b]/v;", None), // { "ecmaVersion": 2024 } ]; - Tester::new(NoEmptyCharacterClass::NAME, NoEmptyCharacterClass::CATEGORY, pass, fail) + Tester::new(NoEmptyCharacterClass::NAME, NoEmptyCharacterClass::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_empty_function.rs b/crates/oxc_linter/src/rules/eslint/no_empty_function.rs index 6910c3602dcd6..54b2a27f1efbb 100644 --- a/crates/oxc_linter/src/rules/eslint/no_empty_function.rs +++ b/crates/oxc_linter/src/rules/eslint/no_empty_function.rs @@ -57,6 +57,7 @@ declare_oxc_lint!( /// const add = (a, b) => a + b /// ``` NoEmptyFunction, + eslint, restriction, ); @@ -226,5 +227,5 @@ fn test() { ", ]; - Tester::new(NoEmptyFunction::NAME, NoEmptyFunction::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoEmptyFunction::NAME, NoEmptyFunction::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_empty_pattern.rs b/crates/oxc_linter/src/rules/eslint/no_empty_pattern.rs index a1e03d5aa97aa..0874e3ec1c1a1 100644 --- a/crates/oxc_linter/src/rules/eslint/no_empty_pattern.rs +++ b/crates/oxc_linter/src/rules/eslint/no_empty_pattern.rs @@ -69,6 +69,7 @@ declare_oxc_lint!( /// ``` /// NoEmptyPattern, + eslint, correctness, ); @@ -110,5 +111,5 @@ fn test() { ("function foo({a: []}) {}", None), ]; - Tester::new(NoEmptyPattern::NAME, NoEmptyPattern::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoEmptyPattern::NAME, NoEmptyPattern::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_empty_static_block.rs b/crates/oxc_linter/src/rules/eslint/no_empty_static_block.rs index 659e8880cdd50..cf88fc495d94c 100644 --- a/crates/oxc_linter/src/rules/eslint/no_empty_static_block.rs +++ b/crates/oxc_linter/src/rules/eslint/no_empty_static_block.rs @@ -47,6 +47,7 @@ declare_oxc_lint!( /// } /// ``` NoEmptyStaticBlock, + eslint, correctness, suggestion, ); @@ -101,7 +102,7 @@ fn test() { ("class Foo { static { bar(); } static {} }", "class Foo { static { bar(); } }"), ]; - Tester::new(NoEmptyStaticBlock::NAME, NoEmptyStaticBlock::CATEGORY, pass, fail) + Tester::new(NoEmptyStaticBlock::NAME, NoEmptyStaticBlock::PLUGIN, pass, fail) .expect_fix(fix) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_eq_null.rs b/crates/oxc_linter/src/rules/eslint/no_eq_null.rs index 23ff883c04e6e..b5f1ef6f1e7dc 100644 --- a/crates/oxc_linter/src/rules/eslint/no_eq_null.rs +++ b/crates/oxc_linter/src/rules/eslint/no_eq_null.rs @@ -53,6 +53,7 @@ declare_oxc_lint!( /// } /// ``` NoEqNull, + eslint, restriction, fix_dangerous ); @@ -112,5 +113,5 @@ fn test() { ("do {} while (null == x)", "do {} while (null === x)"), ]; - Tester::new(NoEqNull::NAME, NoEqNull::CATEGORY, pass, fail).expect_fix(fix).test_and_snapshot(); + Tester::new(NoEqNull::NAME, NoEqNull::PLUGIN, pass, fail).expect_fix(fix).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_eval.rs b/crates/oxc_linter/src/rules/eslint/no_eval.rs index 4a4ef361803af..5e35196ef4d9d 100644 --- a/crates/oxc_linter/src/rules/eslint/no_eval.rs +++ b/crates/oxc_linter/src/rules/eslint/no_eval.rs @@ -44,6 +44,7 @@ declare_oxc_lint!( /// eval(someString); /// ``` NoEval, + eslint, restriction ); @@ -237,5 +238,5 @@ fn test() { // ("function foo() { 'use strict'; this.eval(); }", None), ]; - Tester::new(NoEval::NAME, NoEval::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoEval::NAME, NoEval::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_ex_assign.rs b/crates/oxc_linter/src/rules/eslint/no_ex_assign.rs index 38f665bc84cef..8fc0baa1dd170 100644 --- a/crates/oxc_linter/src/rules/eslint/no_ex_assign.rs +++ b/crates/oxc_linter/src/rules/eslint/no_ex_assign.rs @@ -32,6 +32,7 @@ declare_oxc_lint!( /// } /// ``` NoExAssign, + eslint, correctness ); @@ -68,5 +69,5 @@ fn test() { ("try { } catch ({message}) { message = 10; }", None), ]; - Tester::new(NoExAssign::NAME, NoExAssign::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoExAssign::NAME, NoExAssign::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_extend_native.rs b/crates/oxc_linter/src/rules/eslint/no_extend_native.rs index 7b8392b4d346d..0825b691d6f0f 100644 --- a/crates/oxc_linter/src/rules/eslint/no_extend_native.rs +++ b/crates/oxc_linter/src/rules/eslint/no_extend_native.rs @@ -66,6 +66,7 @@ declare_oxc_lint!( /// Object.defineProperty(x.prototype, 'p', {value: 0}) /// ``` NoExtendNative, + eslint, suspicious, ); @@ -316,5 +317,5 @@ fn test() { ("Array.prototype.p ??= 0", None), // { "ecmaVersion": 2021 } ]; - Tester::new(NoExtendNative::NAME, NoExtendNative::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoExtendNative::NAME, NoExtendNative::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_extra_boolean_cast.rs b/crates/oxc_linter/src/rules/eslint/no_extra_boolean_cast.rs index f72c761d74d7d..e51b4dbb9e1f4 100644 --- a/crates/oxc_linter/src/rules/eslint/no_extra_boolean_cast.rs +++ b/crates/oxc_linter/src/rules/eslint/no_extra_boolean_cast.rs @@ -44,6 +44,7 @@ declare_oxc_lint!( /// if (!!foo || bar) {} /// ``` NoExtraBooleanCast, + eslint, correctness, // a suggestion could be added. Note that lacking !! can mess up TS type // narrowing sometimes, so it should not be an autofix @@ -872,6 +873,6 @@ fn test() { ("if (!Boolean(a as any)) { }", None), ]; - Tester::new(NoExtraBooleanCast::NAME, NoExtraBooleanCast::CATEGORY, pass, fail) + Tester::new(NoExtraBooleanCast::NAME, NoExtraBooleanCast::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_extra_label.rs b/crates/oxc_linter/src/rules/eslint/no_extra_label.rs index e2868599fc06c..27f341b4083e2 100644 --- a/crates/oxc_linter/src/rules/eslint/no_extra_label.rs +++ b/crates/oxc_linter/src/rules/eslint/no_extra_label.rs @@ -83,6 +83,7 @@ declare_oxc_lint!( /// } /// ``` NoExtraLabel, + eslint, style, fix ); @@ -272,7 +273,7 @@ fn test() { None, ), ]; - Tester::new(NoExtraLabel::NAME, NoExtraLabel::CATEGORY, pass, fail) + Tester::new(NoExtraLabel::NAME, NoExtraLabel::PLUGIN, pass, fail) .expect_fix(fix) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_fallthrough.rs b/crates/oxc_linter/src/rules/eslint/no_fallthrough.rs index a54a406cc384b..4a98150b9d127 100644 --- a/crates/oxc_linter/src/rules/eslint/no_fallthrough.rs +++ b/crates/oxc_linter/src/rules/eslint/no_fallthrough.rs @@ -243,6 +243,7 @@ declare_oxc_lint!( /// Note that the last case statement in these examples does not cause a /// warning because there is nothing to fall through into. NoFallthrough, + eslint, // TODO: add options section to docs pedantic, // Fall through code are still incorrect. pending // TODO: add a dangerous suggestion for this rule. @@ -670,5 +671,5 @@ fn test() { // ("switch (a === b ? c : d) { case 1: ; case 2: ; case 3: ; }", None) ]; - Tester::new(NoFallthrough::NAME, NoFallthrough::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoFallthrough::NAME, NoFallthrough::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_func_assign.rs b/crates/oxc_linter/src/rules/eslint/no_func_assign.rs index f38e6960187e0..96888144fcc08 100644 --- a/crates/oxc_linter/src/rules/eslint/no_func_assign.rs +++ b/crates/oxc_linter/src/rules/eslint/no_func_assign.rs @@ -28,6 +28,7 @@ declare_oxc_lint!( /// foo = bar; /// ``` NoFuncAssign, + eslint, correctness ); @@ -73,5 +74,5 @@ fn test() { ("var a = function foo() { foo = 123; };", None), ]; - Tester::new(NoFuncAssign::NAME, NoFuncAssign::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoFuncAssign::NAME, NoFuncAssign::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_global_assign.rs b/crates/oxc_linter/src/rules/eslint/no_global_assign.rs index d65b80fc332b1..e67a997a5c39e 100644 --- a/crates/oxc_linter/src/rules/eslint/no_global_assign.rs +++ b/crates/oxc_linter/src/rules/eslint/no_global_assign.rs @@ -37,6 +37,7 @@ declare_oxc_lint!( /// Object = null /// ``` NoGlobalAssign, + eslint, correctness ); @@ -105,5 +106,5 @@ fn test() { ("Array = 1;", None), ]; - Tester::new(NoGlobalAssign::NAME, NoGlobalAssign::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoGlobalAssign::NAME, NoGlobalAssign::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_import_assign.rs b/crates/oxc_linter/src/rules/eslint/no_import_assign.rs index 71ad13e6d9d68..4b6590c1d2df8 100644 --- a/crates/oxc_linter/src/rules/eslint/no_import_assign.rs +++ b/crates/oxc_linter/src/rules/eslint/no_import_assign.rs @@ -40,6 +40,7 @@ declare_oxc_lint!( /// Object.assign(mod_ns, { foo: "foo" }) // ERROR: The members of 'mod_ns' are readonly. /// ``` NoImportAssign, + eslint, correctness ); @@ -264,5 +265,5 @@ fn test() { ("import * as mod from 'mod'; delete mod?.prop", None), ]; - Tester::new(NoImportAssign::NAME, NoImportAssign::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoImportAssign::NAME, NoImportAssign::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_inner_declarations.rs b/crates/oxc_linter/src/rules/eslint/no_inner_declarations.rs index c84ce092b5b67..877f3f4f3cba6 100644 --- a/crates/oxc_linter/src/rules/eslint/no_inner_declarations.rs +++ b/crates/oxc_linter/src/rules/eslint/no_inner_declarations.rs @@ -44,6 +44,7 @@ declare_oxc_lint!( /// } /// ``` NoInnerDeclarations, + eslint, pedantic ); @@ -196,6 +197,6 @@ fn test() { ), ]; - Tester::new(NoInnerDeclarations::NAME, NoInnerDeclarations::CATEGORY, pass, fail) + Tester::new(NoInnerDeclarations::NAME, NoInnerDeclarations::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_invalid_regexp.rs b/crates/oxc_linter/src/rules/eslint/no_invalid_regexp.rs index 00cf6f5c3c4cc..de307f9d008d2 100644 --- a/crates/oxc_linter/src/rules/eslint/no_invalid_regexp.rs +++ b/crates/oxc_linter/src/rules/eslint/no_invalid_regexp.rs @@ -50,6 +50,7 @@ declare_oxc_lint!( /// this.RegExp('[') /// ``` NoInvalidRegexp, + eslint, correctness, ); @@ -340,5 +341,5 @@ fn test() { ("new RegExp('(?a)(?b)')", None), ]; - Tester::new(NoInvalidRegexp::NAME, NoInvalidRegexp::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoInvalidRegexp::NAME, NoInvalidRegexp::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_irregular_whitespace.rs b/crates/oxc_linter/src/rules/eslint/no_irregular_whitespace.rs index 47c615c855e0a..f335c3e122e63 100644 --- a/crates/oxc_linter/src/rules/eslint/no_irregular_whitespace.rs +++ b/crates/oxc_linter/src/rules/eslint/no_irregular_whitespace.rs @@ -28,6 +28,7 @@ declare_oxc_lint!( /// } /// ``` NoIrregularWhitespace, + eslint, correctness ); @@ -405,6 +406,6 @@ fn test() { // (r"
 
;", None), ]; - Tester::new(NoIrregularWhitespace::NAME, NoIrregularWhitespace::CATEGORY, pass, fail) + Tester::new(NoIrregularWhitespace::NAME, NoIrregularWhitespace::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_iterator.rs b/crates/oxc_linter/src/rules/eslint/no_iterator.rs index e94e58bdfd494..50678c0314c50 100644 --- a/crates/oxc_linter/src/rules/eslint/no_iterator.rs +++ b/crates/oxc_linter/src/rules/eslint/no_iterator.rs @@ -53,6 +53,7 @@ declare_oxc_lint!( /// }; /// ``` NoIterator, + eslint, restriction, pending // TODO: suggestion ); @@ -93,5 +94,5 @@ fn test() { "test[`__iterator__`] = function () {};", ]; - Tester::new(NoIterator::NAME, NoIterator::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoIterator::NAME, NoIterator::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_label_var.rs b/crates/oxc_linter/src/rules/eslint/no_label_var.rs index 8a8c3405b230f..f87adc1825dc4 100644 --- a/crates/oxc_linter/src/rules/eslint/no_label_var.rs +++ b/crates/oxc_linter/src/rules/eslint/no_label_var.rs @@ -55,6 +55,7 @@ declare_oxc_lint!( /// } /// ``` NoLabelVar, + eslint, style, ); @@ -91,5 +92,5 @@ fn test() { "function bar(x) { x: for(;;) { break x; } }", ]; - Tester::new(NoLabelVar::NAME, NoLabelVar::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoLabelVar::NAME, NoLabelVar::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_labels.rs b/crates/oxc_linter/src/rules/eslint/no_labels.rs index 4fb28a7cc410b..184347cee6c23 100644 --- a/crates/oxc_linter/src/rules/eslint/no_labels.rs +++ b/crates/oxc_linter/src/rules/eslint/no_labels.rs @@ -119,6 +119,7 @@ declare_oxc_lint!( /// } /// ``` NoLabels, + eslint, style, ); @@ -268,5 +269,5 @@ fn test() { ), ]; - Tester::new(NoLabels::NAME, NoLabels::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoLabels::NAME, NoLabels::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_loss_of_precision.rs b/crates/oxc_linter/src/rules/eslint/no_loss_of_precision.rs index 70cd1a40dfee4..fdb4d3ab44d4f 100644 --- a/crates/oxc_linter/src/rules/eslint/no_loss_of_precision.rs +++ b/crates/oxc_linter/src/rules/eslint/no_loss_of_precision.rs @@ -31,6 +31,7 @@ declare_oxc_lint!( /// var x = 2e999; /// ``` NoLossOfPrecision, + eslint, correctness ); @@ -356,6 +357,5 @@ fn test() { ("var x = 1e18_446_744_073_709_551_615", None), ]; - Tester::new(NoLossOfPrecision::NAME, NoLossOfPrecision::CATEGORY, pass, fail) - .test_and_snapshot(); + Tester::new(NoLossOfPrecision::NAME, NoLossOfPrecision::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_magic_numbers.rs b/crates/oxc_linter/src/rules/eslint/no_magic_numbers.rs index 45a9ce45c04e6..50fac0fb20472 100644 --- a/crates/oxc_linter/src/rules/eslint/no_magic_numbers.rs +++ b/crates/oxc_linter/src/rules/eslint/no_magic_numbers.rs @@ -225,6 +225,7 @@ declare_oxc_lint!( /// type Baz = Parameters[2]; /// ``` NoMagicNumbers, + eslint, style, pending // TODO: enforceConst, probably copy from https://github.com/oxc-project/oxc/pull/5144 ); @@ -919,5 +920,5 @@ fn test() { ("type Foo = -7.1e-8;", Some(serde_json::json!([{ "ignore": [7.1e-8] }]))), ]; - Tester::new(NoMagicNumbers::NAME, NoMagicNumbers::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoMagicNumbers::NAME, NoMagicNumbers::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_multi_assign.rs b/crates/oxc_linter/src/rules/eslint/no_multi_assign.rs index 72a1b548ed5cf..13500b0e02987 100644 --- a/crates/oxc_linter/src/rules/eslint/no_multi_assign.rs +++ b/crates/oxc_linter/src/rules/eslint/no_multi_assign.rs @@ -101,6 +101,7 @@ declare_oxc_lint!( /// } /// ``` NoMultiAssign, + eslint, style, ); @@ -222,5 +223,5 @@ fn test() { ), // { "ecmaVersion": 2022 } ]; - Tester::new(NoMultiAssign::NAME, NoMultiAssign::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoMultiAssign::NAME, NoMultiAssign::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_multi_str.rs b/crates/oxc_linter/src/rules/eslint/no_multi_str.rs index 8aa2abe4ea4f9..c38b8ec1bf5ef 100644 --- a/crates/oxc_linter/src/rules/eslint/no_multi_str.rs +++ b/crates/oxc_linter/src/rules/eslint/no_multi_str.rs @@ -29,6 +29,7 @@ declare_oxc_lint!( /// Line 2"; /// ``` NoMultiStr, + eslint, style, ); @@ -83,5 +84,5 @@ fn test() { "'\\
still fails';", ]; - Tester::new(NoMultiStr::NAME, NoMultiStr::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoMultiStr::NAME, NoMultiStr::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_negated_condition.rs b/crates/oxc_linter/src/rules/eslint/no_negated_condition.rs index 60ffa1770a169..36a965bc9e4b2 100644 --- a/crates/oxc_linter/src/rules/eslint/no_negated_condition.rs +++ b/crates/oxc_linter/src/rules/eslint/no_negated_condition.rs @@ -52,6 +52,7 @@ declare_oxc_lint!( /// a ? doSomethingB() : doSomethingC() /// ``` NoNegatedCondition, + eslint, pedantic, pending ); @@ -163,6 +164,6 @@ fn test() { r"(!!a) ? b() : c();", ]; - Tester::new(NoNegatedCondition::NAME, NoNegatedCondition::CATEGORY, pass, fail) + Tester::new(NoNegatedCondition::NAME, NoNegatedCondition::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_nested_ternary.rs b/crates/oxc_linter/src/rules/eslint/no_nested_ternary.rs index 2508793abe4cd..8b7ce669a92ea 100644 --- a/crates/oxc_linter/src/rules/eslint/no_nested_ternary.rs +++ b/crates/oxc_linter/src/rules/eslint/no_nested_ternary.rs @@ -39,6 +39,7 @@ declare_oxc_lint!( /// } /// ``` NoNestedTernary, + eslint, style, ); @@ -96,5 +97,5 @@ fn test() { "var result = foo ? (bar as string) : (baz as number ? qux : quux);", ]; - Tester::new(NoNestedTernary::NAME, NoNestedTernary::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoNestedTernary::NAME, NoNestedTernary::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_new.rs b/crates/oxc_linter/src/rules/eslint/no_new.rs index 3dd5910d440d3..e040eba93a085 100644 --- a/crates/oxc_linter/src/rules/eslint/no_new.rs +++ b/crates/oxc_linter/src/rules/eslint/no_new.rs @@ -27,6 +27,7 @@ declare_oxc_lint!( /// new Person(); /// ``` NoNew, + eslint, suspicious, ); @@ -66,5 +67,5 @@ fn test() { let fail = vec!["new Date()", "(() => { new Date() })"]; - Tester::new(NoNew::NAME, NoNew::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoNew::NAME, NoNew::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_new_func.rs b/crates/oxc_linter/src/rules/eslint/no_new_func.rs index e497d03280490..762f2926dade7 100644 --- a/crates/oxc_linter/src/rules/eslint/no_new_func.rs +++ b/crates/oxc_linter/src/rules/eslint/no_new_func.rs @@ -41,6 +41,7 @@ declare_oxc_lint!( /// }; /// ``` NoNewFunc, + eslint, style ); @@ -132,5 +133,5 @@ fn test() { "var fn = function () { function Function() {} }; Function('', '')", ]; - Tester::new(NoNewFunc::NAME, NoNewFunc::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoNewFunc::NAME, NoNewFunc::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_new_native_nonconstructor.rs b/crates/oxc_linter/src/rules/eslint/no_new_native_nonconstructor.rs index 5174baebfb47f..b9c9da592dfcb 100644 --- a/crates/oxc_linter/src/rules/eslint/no_new_native_nonconstructor.rs +++ b/crates/oxc_linter/src/rules/eslint/no_new_native_nonconstructor.rs @@ -41,6 +41,7 @@ declare_oxc_lint!( /// let result = BigInt(9007199254740991); /// ``` NoNewNativeNonconstructor, + eslint, correctness, ); @@ -89,6 +90,6 @@ fn test() { "function bar() { return function BigInt() {}; } var baz = new BigInt(9007199254740991);", ]; - Tester::new(NoNewNativeNonconstructor::NAME, NoNewNativeNonconstructor::CATEGORY, pass, fail) + Tester::new(NoNewNativeNonconstructor::NAME, NoNewNativeNonconstructor::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_new_wrappers.rs b/crates/oxc_linter/src/rules/eslint/no_new_wrappers.rs index 48ae553b2fc66..0760a1d004301 100644 --- a/crates/oxc_linter/src/rules/eslint/no_new_wrappers.rs +++ b/crates/oxc_linter/src/rules/eslint/no_new_wrappers.rs @@ -46,6 +46,7 @@ declare_oxc_lint!( /// var booleanObject = Boolean(value); /// ``` NoNewWrappers, + eslint, pedantic, pending ); @@ -108,5 +109,5 @@ fn test() { ", ]; - Tester::new(NoNewWrappers::NAME, NoNewWrappers::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoNewWrappers::NAME, NoNewWrappers::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_nonoctal_decimal_escape.rs b/crates/oxc_linter/src/rules/eslint/no_nonoctal_decimal_escape.rs index 57420e775b6bd..c8cf67e449633 100644 --- a/crates/oxc_linter/src/rules/eslint/no_nonoctal_decimal_escape.rs +++ b/crates/oxc_linter/src/rules/eslint/no_nonoctal_decimal_escape.rs @@ -39,6 +39,7 @@ declare_oxc_lint!( /// "\\9" /// ``` NoNonoctalDecimalEscape, + eslint, correctness, pending ); @@ -227,6 +228,6 @@ fn test() { r"'\0\\n\8'", ]; - Tester::new(NoNonoctalDecimalEscape::NAME, NoNonoctalDecimalEscape::CATEGORY, pass, fail) + Tester::new(NoNonoctalDecimalEscape::NAME, NoNonoctalDecimalEscape::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_obj_calls.rs b/crates/oxc_linter/src/rules/eslint/no_obj_calls.rs index e20e8edd49e38..5cdd7cd0d1c57 100644 --- a/crates/oxc_linter/src/rules/eslint/no_obj_calls.rs +++ b/crates/oxc_linter/src/rules/eslint/no_obj_calls.rs @@ -63,6 +63,7 @@ declare_oxc_lint! { /// let segmenterFrom = Intl.Segmenter("fr", { granularity: "word" }); /// ``` NoObjCalls, + eslint, correctness, } @@ -216,5 +217,5 @@ fn test() { ("let m = globalThis.Math; new m();", None), ]; - Tester::new(NoObjCalls::NAME, NoObjCalls::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoObjCalls::NAME, NoObjCalls::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_object_constructor.rs b/crates/oxc_linter/src/rules/eslint/no_object_constructor.rs index 36c6beda52281..7cc903b93749e 100644 --- a/crates/oxc_linter/src/rules/eslint/no_object_constructor.rs +++ b/crates/oxc_linter/src/rules/eslint/no_object_constructor.rs @@ -40,6 +40,7 @@ declare_oxc_lint!( /// const createObject = Object => new Object(); /// ``` NoObjectConstructor, + eslint, pedantic, pending ); @@ -173,6 +174,6 @@ fn test() { }", ]; - Tester::new(NoObjectConstructor::NAME, NoObjectConstructor::CATEGORY, pass, fail) + Tester::new(NoObjectConstructor::NAME, NoObjectConstructor::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_plusplus.rs b/crates/oxc_linter/src/rules/eslint/no_plusplus.rs index 83fceacc432ff..7b4aba5219cb5 100644 --- a/crates/oxc_linter/src/rules/eslint/no_plusplus.rs +++ b/crates/oxc_linter/src/rules/eslint/no_plusplus.rs @@ -77,6 +77,7 @@ declare_oxc_lint!( /// } /// ``` NoPlusplus, + eslint, restriction, // This is not guaranteed to rewrite the code in a way that is equivalent. // For example, `++i` and `i++` will be rewritten as `i += 1` even though they are not the same. @@ -266,7 +267,7 @@ fn test() { ), ]; - Tester::new(NoPlusplus::NAME, NoPlusplus::CATEGORY, pass, fail) + Tester::new(NoPlusplus::NAME, NoPlusplus::PLUGIN, pass, fail) .expect_fix(fix) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_proto.rs b/crates/oxc_linter/src/rules/eslint/no_proto.rs index 47474a5664675..4fe31a79d3a84 100644 --- a/crates/oxc_linter/src/rules/eslint/no_proto.rs +++ b/crates/oxc_linter/src/rules/eslint/no_proto.rs @@ -36,6 +36,7 @@ declare_oxc_lint!( /// obj["__proto__"] = b; /// ``` NoProto, + eslint, restriction, pending ); @@ -76,5 +77,5 @@ fn test() { "test[`__proto__`] = function () {};", ]; - Tester::new(NoProto::NAME, NoProto::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoProto::NAME, NoProto::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_prototype_builtins.rs b/crates/oxc_linter/src/rules/eslint/no_prototype_builtins.rs index 67e0766ae2874..a6435781b0dde 100644 --- a/crates/oxc_linter/src/rules/eslint/no_prototype_builtins.rs +++ b/crates/oxc_linter/src/rules/eslint/no_prototype_builtins.rs @@ -41,6 +41,7 @@ declare_oxc_lint!( /// var barIsEnumerable = foo.propertyIsEnumerable("bar"); /// ``` NoPrototypeBuiltins, + eslint, pedantic ); @@ -112,6 +113,6 @@ fn test() { "(foo?.[`hasOwnProperty`])('bar')", ]; - Tester::new(NoPrototypeBuiltins::NAME, NoPrototypeBuiltins::CATEGORY, pass, fail) + Tester::new(NoPrototypeBuiltins::NAME, NoPrototypeBuiltins::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_redeclare.rs b/crates/oxc_linter/src/rules/eslint/no_redeclare.rs index 17ab5ea9f66a0..e4b9b19b4538d 100644 --- a/crates/oxc_linter/src/rules/eslint/no_redeclare.rs +++ b/crates/oxc_linter/src/rules/eslint/no_redeclare.rs @@ -45,6 +45,7 @@ declare_oxc_lint!( /// var a = 10; /// ``` NoRedeclare, + eslint, pedantic ); @@ -159,5 +160,5 @@ fn test() { ("for (var a, a;;);", None), ]; - Tester::new(NoRedeclare::NAME, NoRedeclare::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoRedeclare::NAME, NoRedeclare::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_regex_spaces.rs b/crates/oxc_linter/src/rules/eslint/no_regex_spaces.rs index 80895db6d4929..6604689d6c85d 100644 --- a/crates/oxc_linter/src/rules/eslint/no_regex_spaces.rs +++ b/crates/oxc_linter/src/rules/eslint/no_regex_spaces.rs @@ -42,6 +42,7 @@ declare_oxc_lint!( /// var re = /foo bar/; /// ``` NoRegexSpaces, + eslint, restriction, pending // TODO: This is somewhat autofixable, but the fixer does not exist yet. ); @@ -248,5 +249,5 @@ fn test() { "var foo = new RegExp('[[ ] ] ', 'v');", ]; - Tester::new(NoRegexSpaces::NAME, NoRegexSpaces::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoRegexSpaces::NAME, NoRegexSpaces::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_restricted_globals.rs b/crates/oxc_linter/src/rules/eslint/no_restricted_globals.rs index 36b91bbd1fcbf..a4ccc5bcb5107 100644 --- a/crates/oxc_linter/src/rules/eslint/no_restricted_globals.rs +++ b/crates/oxc_linter/src/rules/eslint/no_restricted_globals.rs @@ -52,6 +52,7 @@ declare_oxc_lint!( /// } /// ``` NoRestrictedGlobals, + eslint, restriction, ); @@ -148,6 +149,6 @@ fn test() { ), ]; - Tester::new(NoRestrictedGlobals::NAME, NoRestrictedGlobals::CATEGORY, pass, fail) + Tester::new(NoRestrictedGlobals::NAME, NoRestrictedGlobals::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs b/crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs index 6b6976c9409d2..ef7d6936c2084 100644 --- a/crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs +++ b/crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs @@ -100,6 +100,7 @@ declare_oxc_lint!( /// export { foo } from "bar"; /// ``` NoRestrictedImports, + eslint, nursery, ); @@ -1832,6 +1833,6 @@ fn test() { // ), ]; - Tester::new(NoRestrictedImports::NAME, NoRestrictedImports::CATEGORY, pass, fail) + Tester::new(NoRestrictedImports::NAME, NoRestrictedImports::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_return_assign.rs b/crates/oxc_linter/src/rules/eslint/no_return_assign.rs index 3a80b31f32b9f..a725dfd350c60 100644 --- a/crates/oxc_linter/src/rules/eslint/no_return_assign.rs +++ b/crates/oxc_linter/src/rules/eslint/no_return_assign.rs @@ -40,6 +40,7 @@ declare_oxc_lint!( /// function x() { var result = a = b; return result; } /// ``` NoReturnAssign, + eslint, style, pending // TODO: add a suggestion ); @@ -202,5 +203,5 @@ fn test() { ("const foo = (a) => (b) => a = b", None), // { "ecmaVersion": 6 } ]; - Tester::new(NoReturnAssign::NAME, NoReturnAssign::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoReturnAssign::NAME, NoReturnAssign::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_script_url.rs b/crates/oxc_linter/src/rules/eslint/no_script_url.rs index 58095c4f926cb..ceeba53e725f5 100644 --- a/crates/oxc_linter/src/rules/eslint/no_script_url.rs +++ b/crates/oxc_linter/src/rules/eslint/no_script_url.rs @@ -36,6 +36,7 @@ declare_oxc_lint!( /// location.href = `javascript:void(0)`; /// ``` NoScriptUrl, + eslint, style ); @@ -99,5 +100,5 @@ fn test() { "var a = `JavaScript:`;", ]; - Tester::new(NoScriptUrl::NAME, NoScriptUrl::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoScriptUrl::NAME, NoScriptUrl::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_self_assign.rs b/crates/oxc_linter/src/rules/eslint/no_self_assign.rs index 3871854909deb..24828a93d1c98 100644 --- a/crates/oxc_linter/src/rules/eslint/no_self_assign.rs +++ b/crates/oxc_linter/src/rules/eslint/no_self_assign.rs @@ -44,6 +44,7 @@ declare_oxc_lint!( /// [bar, baz] = [bar, qiz]; /// ``` NoSelfAssign, + eslint, correctness ); @@ -365,5 +366,5 @@ fn test() { ("a ??= a", None), ]; - Tester::new(NoSelfAssign::NAME, NoSelfAssign::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoSelfAssign::NAME, NoSelfAssign::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_self_compare.rs b/crates/oxc_linter/src/rules/eslint/no_self_compare.rs index b59c598117b6e..f8fee16e3e9a0 100644 --- a/crates/oxc_linter/src/rules/eslint/no_self_compare.rs +++ b/crates/oxc_linter/src/rules/eslint/no_self_compare.rs @@ -34,6 +34,7 @@ declare_oxc_lint!( /// } /// ``` NoSelfCompare, + eslint, pedantic // The code is not wrong if it is intended to check for NaNs, which is the majority of // the case. ); @@ -87,5 +88,5 @@ fn test() { ("class C { #field; foo() { this.#field === this.#field; } }", None), ]; - Tester::new(NoSelfCompare::NAME, NoSelfCompare::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoSelfCompare::NAME, NoSelfCompare::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_setter_return.rs b/crates/oxc_linter/src/rules/eslint/no_setter_return.rs index ecbb577af46d0..e53008a8e09ba 100644 --- a/crates/oxc_linter/src/rules/eslint/no_setter_return.rs +++ b/crates/oxc_linter/src/rules/eslint/no_setter_return.rs @@ -33,6 +33,7 @@ declare_oxc_lint!( /// } /// ``` NoSetterReturn, + eslint, correctness ); @@ -292,5 +293,5 @@ fn test() { // ("(Object?.defineProperty)(foo, 'bar', { set(val) { return 1; } })", None), ]; - Tester::new(NoSetterReturn::NAME, NoSetterReturn::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoSetterReturn::NAME, NoSetterReturn::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_shadow_restricted_names.rs b/crates/oxc_linter/src/rules/eslint/no_shadow_restricted_names.rs index 2bf0708cbabf0..2087482ad63e4 100644 --- a/crates/oxc_linter/src/rules/eslint/no_shadow_restricted_names.rs +++ b/crates/oxc_linter/src/rules/eslint/no_shadow_restricted_names.rs @@ -34,6 +34,7 @@ declare_oxc_lint!( /// try {} catch(eval){} /// ``` NoShadowRestrictedNames, + eslint, correctness ); @@ -162,6 +163,6 @@ fn test() { ("class foo { #undefined(undefined) { } }", None), ]; - Tester::new(NoShadowRestrictedNames::NAME, NoShadowRestrictedNames::CATEGORY, pass, fail) + Tester::new(NoShadowRestrictedNames::NAME, NoShadowRestrictedNames::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_sparse_arrays.rs b/crates/oxc_linter/src/rules/eslint/no_sparse_arrays.rs index 2ecf764d08715..e102fcc62fe07 100644 --- a/crates/oxc_linter/src/rules/eslint/no_sparse_arrays.rs +++ b/crates/oxc_linter/src/rules/eslint/no_sparse_arrays.rs @@ -22,6 +22,7 @@ declare_oxc_lint!( /// var colors = [ "red",, "blue" ]; /// ``` NoSparseArrays, + eslint, correctness ); @@ -96,5 +97,5 @@ fn test() { , , , , , , , , , , , , , , , , , , , 2];", ]; - Tester::new(NoSparseArrays::NAME, NoSparseArrays::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoSparseArrays::NAME, NoSparseArrays::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_template_curly_in_string.rs b/crates/oxc_linter/src/rules/eslint/no_template_curly_in_string.rs index dabfb53fa9cf2..6e1a301fcc8b6 100644 --- a/crates/oxc_linter/src/rules/eslint/no_template_curly_in_string.rs +++ b/crates/oxc_linter/src/rules/eslint/no_template_curly_in_string.rs @@ -37,6 +37,7 @@ declare_oxc_lint!( /// "Time: ${12 * 60 * 60 * 1000}"; /// ``` NoTemplateCurlyInString, + eslint, style, pending // TODO: conditional_fix ); @@ -112,6 +113,6 @@ fn test() { r#"'Hello, ${{foo: "bar"}.foo}'"#, ]; - Tester::new(NoTemplateCurlyInString::NAME, NoTemplateCurlyInString::CATEGORY, pass, fail) + Tester::new(NoTemplateCurlyInString::NAME, NoTemplateCurlyInString::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_ternary.rs b/crates/oxc_linter/src/rules/eslint/no_ternary.rs index 497a3709dc31a..0445e6f72e919 100644 --- a/crates/oxc_linter/src/rules/eslint/no_ternary.rs +++ b/crates/oxc_linter/src/rules/eslint/no_ternary.rs @@ -30,6 +30,7 @@ declare_oxc_lint!( // } /// ``` NoTernary, + eslint, style ); @@ -56,5 +57,5 @@ fn test() { "function foo(bar) { return bar ? baz : qux; }", ]; - Tester::new(NoTernary::NAME, NoTernary::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoTernary::NAME, NoTernary::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_this_before_super.rs b/crates/oxc_linter/src/rules/eslint/no_this_before_super.rs index 2cea7fe707a88..251244be633c1 100644 --- a/crates/oxc_linter/src/rules/eslint/no_this_before_super.rs +++ b/crates/oxc_linter/src/rules/eslint/no_this_before_super.rs @@ -42,6 +42,7 @@ declare_oxc_lint!( /// } /// ``` NoThisBeforeSuper, + eslint, correctness ); @@ -486,6 +487,5 @@ fn test() { ), ]; - Tester::new(NoThisBeforeSuper::NAME, NoThisBeforeSuper::CATEGORY, pass, fail) - .test_and_snapshot(); + Tester::new(NoThisBeforeSuper::NAME, NoThisBeforeSuper::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_throw_literal.rs b/crates/oxc_linter/src/rules/eslint/no_throw_literal.rs index 2100b14b075f8..0ecd1d608886c 100644 --- a/crates/oxc_linter/src/rules/eslint/no_throw_literal.rs +++ b/crates/oxc_linter/src/rules/eslint/no_throw_literal.rs @@ -65,6 +65,7 @@ declare_oxc_lint!( /// } /// ``` NoThrowLiteral, + eslint, pedantic, conditional_suggestion, ); @@ -270,7 +271,7 @@ fn test() { ("throw 'error' satisfies Error", "throw new Error('error' satisfies Error)"), ]; - Tester::new(NoThrowLiteral::NAME, NoThrowLiteral::CATEGORY, pass, fail) + Tester::new(NoThrowLiteral::NAME, NoThrowLiteral::PLUGIN, pass, fail) .expect_fix(fix) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_undef.rs b/crates/oxc_linter/src/rules/eslint/no_undef.rs index 7f0edf3ac4813..592e2a5966442 100644 --- a/crates/oxc_linter/src/rules/eslint/no_undef.rs +++ b/crates/oxc_linter/src/rules/eslint/no_undef.rs @@ -31,6 +31,7 @@ declare_oxc_lint!( /// var bar = a + 1; /// ``` NoUndef, + eslint, nursery ); @@ -193,7 +194,7 @@ fn test() { "hasOwnProperty()", ]; - Tester::new(NoUndef::NAME, NoUndef::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoUndef::NAME, NoUndef::PLUGIN, pass, fail).test_and_snapshot(); let pass = vec![]; let fail = vec![( @@ -201,10 +202,10 @@ fn test() { Some(serde_json::json!([{ "typeof": true }])), )]; - Tester::new(NoUndef::NAME, NoUndef::CATEGORY, pass, fail).test(); + Tester::new(NoUndef::NAME, NoUndef::PLUGIN, pass, fail).test(); let pass = vec![("foo", None, Some(serde_json::json!({ "globals": { "foo": "readonly" } })))]; let fail = vec![("foo", None, Some(serde_json::json!({ "globals": { "foo": "off" } })))]; - Tester::new(NoUndef::NAME, NoUndef::CATEGORY, pass, fail).test(); + Tester::new(NoUndef::NAME, NoUndef::PLUGIN, pass, fail).test(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_undefined.rs b/crates/oxc_linter/src/rules/eslint/no_undefined.rs index d5034cc0c3bdf..3680becd7e0ce 100644 --- a/crates/oxc_linter/src/rules/eslint/no_undefined.rs +++ b/crates/oxc_linter/src/rules/eslint/no_undefined.rs @@ -53,6 +53,7 @@ declare_oxc_lint!( /// ``` /// NoUndefined, + eslint, restriction, ); @@ -138,5 +139,5 @@ fn test() { "[a = undefined] = b", ]; - Tester::new(NoUndefined::NAME, NoUndefined::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoUndefined::NAME, NoUndefined::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_unexpected_multiline.rs b/crates/oxc_linter/src/rules/eslint/no_unexpected_multiline.rs index d811a1fcc3399..f2ffa0f98e9c2 100644 --- a/crates/oxc_linter/src/rules/eslint/no_unexpected_multiline.rs +++ b/crates/oxc_linter/src/rules/eslint/no_unexpected_multiline.rs @@ -101,6 +101,7 @@ declare_oxc_lint!( /// /bar/g.test(baz) /// ``` NoUnexpectedMultiline, + eslint, suspicious, fix_dangerous ); @@ -390,7 +391,7 @@ fn test() { // TODO: add more fixer tests let fix = vec![("var a = b\n(x || y).doSomething()", "var a = b\n;(x || y).doSomething()")]; - Tester::new(NoUnexpectedMultiline::NAME, NoUnexpectedMultiline::CATEGORY, pass, fail) + Tester::new(NoUnexpectedMultiline::NAME, NoUnexpectedMultiline::PLUGIN, pass, fail) .expect_fix(fix) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_unreachable.rs b/crates/oxc_linter/src/rules/eslint/no_unreachable.rs index 97d2b328a84d3..c41c482f5a79a 100644 --- a/crates/oxc_linter/src/rules/eslint/no_unreachable.rs +++ b/crates/oxc_linter/src/rules/eslint/no_unreachable.rs @@ -47,6 +47,7 @@ declare_oxc_lint!( /// } /// ``` NoUnreachable, + eslint, nursery ); @@ -347,5 +348,5 @@ fn test() { "function foo() { var x = 1; do { } while (true); x = 2; }", ]; - Tester::new(NoUnreachable::NAME, NoUnreachable::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoUnreachable::NAME, NoUnreachable::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_unsafe_finally.rs b/crates/oxc_linter/src/rules/eslint/no_unsafe_finally.rs index 22ce3326ad3c2..8881255987a2d 100644 --- a/crates/oxc_linter/src/rules/eslint/no_unsafe_finally.rs +++ b/crates/oxc_linter/src/rules/eslint/no_unsafe_finally.rs @@ -43,6 +43,7 @@ declare_oxc_lint!( /// // > 3 /// ``` NoUnsafeFinally, + eslint, correctness ); @@ -225,5 +226,5 @@ fn test() { ), ]; - Tester::new(NoUnsafeFinally::NAME, NoUnsafeFinally::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoUnsafeFinally::NAME, NoUnsafeFinally::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_unsafe_negation.rs b/crates/oxc_linter/src/rules/eslint/no_unsafe_negation.rs index d5e526130e495..4ecc0ed4e8e21 100644 --- a/crates/oxc_linter/src/rules/eslint/no_unsafe_negation.rs +++ b/crates/oxc_linter/src/rules/eslint/no_unsafe_negation.rs @@ -39,6 +39,7 @@ declare_oxc_lint!( /// } /// ``` NoUnsafeNegation, + eslint, correctness, fix ); @@ -157,7 +158,7 @@ fn test() { // ("!a <= b", "!(a <= b)"), ]; - Tester::new(NoUnsafeNegation::NAME, NoUnsafeNegation::CATEGORY, pass, fail) + Tester::new(NoUnsafeNegation::NAME, NoUnsafeNegation::PLUGIN, pass, fail) .expect_fix(fix) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_unsafe_optional_chaining.rs b/crates/oxc_linter/src/rules/eslint/no_unsafe_optional_chaining.rs index ed338bea1b460..a1d48ad0b7acf 100644 --- a/crates/oxc_linter/src/rules/eslint/no_unsafe_optional_chaining.rs +++ b/crates/oxc_linter/src/rules/eslint/no_unsafe_optional_chaining.rs @@ -49,6 +49,7 @@ declare_oxc_lint!( /// const { bar } = obj?.foo; // TypeError /// ``` NoUnsafeOptionalChaining, + eslint, correctness ); @@ -274,6 +275,6 @@ fn test() { ("(foo ? obj?.foo : obj?.bar).bar", None), ]; - Tester::new(NoUnsafeOptionalChaining::NAME, NoUnsafeOptionalChaining::CATEGORY, pass, fail) + Tester::new(NoUnsafeOptionalChaining::NAME, NoUnsafeOptionalChaining::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_unused_expressions.rs b/crates/oxc_linter/src/rules/eslint/no_unused_expressions.rs index 9b3ccec059a53..079d33b5332de 100644 --- a/crates/oxc_linter/src/rules/eslint/no_unused_expressions.rs +++ b/crates/oxc_linter/src/rules/eslint/no_unused_expressions.rs @@ -49,6 +49,7 @@ declare_oxc_lint!( /// const foo = new Set(); /// ``` NoUnusedExpressions, + eslint, restriction ); @@ -534,6 +535,6 @@ fn test() { ("const _func = (value: number) => { value + 1; }", None), ]; - Tester::new(NoUnusedExpressions::NAME, NoUnusedExpressions::CATEGORY, pass, fail) + Tester::new(NoUnusedExpressions::NAME, NoUnusedExpressions::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_unused_labels.rs b/crates/oxc_linter/src/rules/eslint/no_unused_labels.rs index d5f55acdedaf1..cbcf2834964f0 100644 --- a/crates/oxc_linter/src/rules/eslint/no_unused_labels.rs +++ b/crates/oxc_linter/src/rules/eslint/no_unused_labels.rs @@ -33,6 +33,7 @@ declare_oxc_lint!( /// } /// ``` NoUnusedLabels, + eslint, correctness, fix ); @@ -95,7 +96,7 @@ fn test() { ), ]; - Tester::new(NoUnusedLabels::NAME, NoUnusedLabels::CATEGORY, pass, fail) + Tester::new(NoUnusedLabels::NAME, NoUnusedLabels::PLUGIN, pass, fail) .expect_fix(fix) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_unused_private_class_members.rs b/crates/oxc_linter/src/rules/eslint/no_unused_private_class_members.rs index e3765803b1878..89100c139728c 100644 --- a/crates/oxc_linter/src/rules/eslint/no_unused_private_class_members.rs +++ b/crates/oxc_linter/src/rules/eslint/no_unused_private_class_members.rs @@ -85,6 +85,7 @@ declare_oxc_lint!( /// /// ``` NoUnusedPrivateClassMembers, + eslint, correctness ); @@ -445,11 +446,6 @@ fn test() { }", ]; - Tester::new( - NoUnusedPrivateClassMembers::NAME, - NoUnusedPrivateClassMembers::CATEGORY, - pass, - fail, - ) - .test_and_snapshot(); + Tester::new(NoUnusedPrivateClassMembers::NAME, NoUnusedPrivateClassMembers::PLUGIN, pass, fail) + .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_unused_vars/mod.rs b/crates/oxc_linter/src/rules/eslint/no_unused_vars/mod.rs index 9a5f605ca6ec7..6c1aab88ba4b3 100644 --- a/crates/oxc_linter/src/rules/eslint/no_unused_vars/mod.rs +++ b/crates/oxc_linter/src/rules/eslint/no_unused_vars/mod.rs @@ -187,6 +187,7 @@ declare_oxc_lint!( /// var global_var = 42; /// ``` NoUnusedVars, + eslint, correctness, dangerous_suggestion ); diff --git a/crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/eslint.rs b/crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/eslint.rs index e32393dabe549..cc7b07c68b5b3 100644 --- a/crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/eslint.rs +++ b/crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/eslint.rs @@ -22,7 +22,7 @@ fn fixme() { ), // { "ecmaVersion": 2015 }, ]; let fail = vec![]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .intentionally_allow_no_fix_tests() .test(); } @@ -977,7 +977,7 @@ fn test() { ), // { "ecmaVersion": 2015 } ]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .intentionally_allow_no_fix_tests() .with_snapshot_suffix("eslint") .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/oxc.rs b/crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/oxc.rs index 1e2123c79066d..19ac387755d7e 100644 --- a/crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/oxc.rs +++ b/crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/oxc.rs @@ -16,7 +16,7 @@ fn test_debug() { ), // { "ecmaVersion": 6 }, ]; let fail = vec![]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .intentionally_allow_no_fix_tests() .test(); } @@ -153,7 +153,7 @@ fn test_vars_simple() { ("let x: number = 1; x = 2;", "let _x: number = 1; _x = 2;", None, FixKind::DangerousFix), ]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .expect_fix(fix) .with_snapshot_suffix("oxc-vars-simple") .test_and_snapshot(); @@ -183,7 +183,7 @@ fn test_vars_self_use() { ", ]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .intentionally_allow_no_fix_tests() .with_snapshot_suffix("oxc-vars-self-use") .test_and_snapshot(); @@ -248,7 +248,7 @@ fn test_vars_discarded_reads() { ", ]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .intentionally_allow_no_fix_tests() .with_snapshot_suffix("oxc-vars-discarded-read") .test_and_snapshot(); @@ -336,7 +336,7 @@ fn test_vars_reassignment() { "let a = 0, b = 1; let c = b = a = 1; f(c+b);", ]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .intentionally_allow_no_fix_tests() .with_snapshot_suffix("oxc-vars-reassignment") .test_and_snapshot(); @@ -432,7 +432,7 @@ fn test_vars_destructure() { (r#"const l="",{e}=r"#, r"const {e}=r", None, FixKind::All), ]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .expect_fix(fix) .with_snapshot_suffix("oxc-vars-destructure") .test_and_snapshot(); @@ -468,7 +468,7 @@ fn test_vars_catch() { ), ]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .intentionally_allow_no_fix_tests() .with_snapshot_suffix("oxc-vars-catch") .test_and_snapshot(); @@ -480,7 +480,7 @@ fn test_vars_using() { let fail = vec![("using a = 1;", None)]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .intentionally_allow_no_fix_tests() .with_snapshot_suffix("oxc-vars-using") .test_and_snapshot(); @@ -655,7 +655,7 @@ fn test_functions() { ), ]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .with_snapshot_suffix("oxc-functions") .expect_fix(fix) .test_and_snapshot(); @@ -709,7 +709,7 @@ fn test_self_call() { // }", ]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .intentionally_allow_no_fix_tests() .with_snapshot_suffix("oxc-self-call") .test_and_snapshot(); @@ -795,7 +795,7 @@ fn test_imports() { ), ]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .expect_fix(fix) .with_snapshot_suffix("oxc-imports") .test_and_snapshot(); @@ -823,7 +823,7 @@ fn test_used_declarations() { ]; let fail = vec![]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .intentionally_allow_no_fix_tests() .with_snapshot_suffix("oxc-used-declarations") .test_and_snapshot(); @@ -860,7 +860,7 @@ fn test_exports() { let fail = vec!["import { a as b } from 'a'; export { a }"]; // these are mostly pass[] cases, so do not snapshot - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .intentionally_allow_no_fix_tests() .test(); } @@ -908,7 +908,7 @@ fn test_react() { ", ]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .intentionally_allow_no_fix_tests() .test(); } @@ -940,7 +940,7 @@ fn test_arguments() { ("function foo({ a }, b) { return b } foo()", Some(json!([{ "args": "after-used" }]))), ]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .intentionally_allow_no_fix_tests() .with_snapshot_suffix("oxc-arguments") .test_and_snapshot(); @@ -956,7 +956,7 @@ fn test_enums() { let fail = vec!["enum Foo { A }"]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .intentionally_allow_no_fix_tests() .with_snapshot_suffix("oxc-enums") .test_and_snapshot(); @@ -1022,7 +1022,7 @@ fn test_classes() { ", ]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .intentionally_allow_no_fix_tests() .with_snapshot_suffix("oxc-classes") .test_and_snapshot(); @@ -1075,7 +1075,7 @@ fn test_namespaces() { // "export namespace N { function foo() }", ]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .intentionally_allow_no_fix_tests() .with_snapshot_suffix("oxc-namespaces") .test_and_snapshot(); @@ -1093,7 +1093,7 @@ fn test_type_aliases() { "export type F = T extends infer R ? /* R not used */ string : never", ]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .intentionally_allow_no_fix_tests() .with_snapshot_suffix("oxc-type-aliases") .test_and_snapshot(); @@ -1191,7 +1191,7 @@ fn test_type_references() { "interface LinkedList { next: LinkedList | undefined }", ]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .intentionally_allow_no_fix_tests() .with_snapshot_suffix("oxc-type-references") .change_rule_path_extension("ts") @@ -1204,7 +1204,7 @@ fn test_type_references() { // let fail = vec![]; -// Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) +// Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) // .with_snapshot_suffix("") // .test_and_snapshot(); // } diff --git a/crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/react.rs b/crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/react.rs index 65e6cb9b4f216..eea9b5117ec9f 100644 --- a/crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/react.rs +++ b/crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/react.rs @@ -126,7 +126,7 @@ fn test() { ", ]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .intentionally_allow_no_fix_tests() .with_snapshot_suffix("eslint-plugin-react") .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/typescript_eslint.rs b/crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/typescript_eslint.rs index 856db83208ae7..ee39366cce71f 100644 --- a/crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/typescript_eslint.rs +++ b/crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/typescript_eslint.rs @@ -1699,7 +1699,7 @@ fn test() { ("const foo: number = 1;", None), ]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .intentionally_allow_no_fix_tests() .change_rule_path_extension("ts") .with_snapshot_suffix("typescript-eslint") @@ -1867,7 +1867,7 @@ fn test_tsx() { // }, ]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .intentionally_allow_no_fix_tests() .with_snapshot_suffix("typescript-eslint-tsx") .test_and_snapshot(); @@ -1908,7 +1908,7 @@ fn test_d_ts() { ]; let fail = vec![]; - Tester::new(NoUnusedVars::NAME, NoUnusedVars::CATEGORY, pass, fail) + Tester::new(NoUnusedVars::NAME, NoUnusedVars::PLUGIN, pass, fail) .intentionally_allow_no_fix_tests() .change_rule_path_extension("d.ts") .test(); diff --git a/crates/oxc_linter/src/rules/eslint/no_useless_catch.rs b/crates/oxc_linter/src/rules/eslint/no_useless_catch.rs index 79a8d66a9e772..5e99dddfdbd57 100644 --- a/crates/oxc_linter/src/rules/eslint/no_useless_catch.rs +++ b/crates/oxc_linter/src/rules/eslint/no_useless_catch.rs @@ -42,6 +42,7 @@ declare_oxc_lint!( /// } /// ``` NoUselessCatch, + eslint, correctness ); @@ -211,5 +212,5 @@ fn test() { ", ]; - Tester::new(NoUselessCatch::NAME, NoUselessCatch::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoUselessCatch::NAME, NoUselessCatch::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_useless_concat.rs b/crates/oxc_linter/src/rules/eslint/no_useless_concat.rs index f84b50c1da03a..9180b25e53f49 100644 --- a/crates/oxc_linter/src/rules/eslint/no_useless_concat.rs +++ b/crates/oxc_linter/src/rules/eslint/no_useless_concat.rs @@ -32,6 +32,7 @@ declare_oxc_lint!( /// var foo = "a" + "b"; /// ``` NoUselessConcat, + eslint, suspicious ); @@ -133,5 +134,5 @@ fn test() { "'a' + 'b' + 'c' + 'd' + 'e' + foo", ]; - Tester::new(NoUselessConcat::NAME, NoUselessConcat::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoUselessConcat::NAME, NoUselessConcat::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_useless_constructor.rs b/crates/oxc_linter/src/rules/eslint/no_useless_constructor.rs index 67d9c5238d7a7..81e60207c20cf 100644 --- a/crates/oxc_linter/src/rules/eslint/no_useless_constructor.rs +++ b/crates/oxc_linter/src/rules/eslint/no_useless_constructor.rs @@ -93,6 +93,7 @@ declare_oxc_lint!( /// } ///``` NoUselessConstructor, + eslint, suspicious, fix ); @@ -363,7 +364,7 @@ class A extends B { foo() { bar(); } }", ), ]; - Tester::new(NoUselessConstructor::NAME, NoUselessConstructor::CATEGORY, pass, fail) + Tester::new(NoUselessConstructor::NAME, NoUselessConstructor::PLUGIN, pass, fail) .expect_fix(fix) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_useless_escape.rs b/crates/oxc_linter/src/rules/eslint/no_useless_escape.rs index 187d8d8f34ddc..1c518a35071e3 100644 --- a/crates/oxc_linter/src/rules/eslint/no_useless_escape.rs +++ b/crates/oxc_linter/src/rules/eslint/no_useless_escape.rs @@ -68,6 +68,7 @@ declare_oxc_lint!( /// /[a-z-]/; /// ``` NoUselessEscape, + eslint, correctness, fix ); @@ -671,7 +672,7 @@ fn test() { ), ]; - Tester::new(NoUselessEscape::NAME, NoUselessEscape::CATEGORY, pass, fail) + Tester::new(NoUselessEscape::NAME, NoUselessEscape::PLUGIN, pass, fail) .expect_fix(fix) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_useless_rename.rs b/crates/oxc_linter/src/rules/eslint/no_useless_rename.rs index 8ee83d2ccb67c..d19d5e9a7e4a0 100644 --- a/crates/oxc_linter/src/rules/eslint/no_useless_rename.rs +++ b/crates/oxc_linter/src/rules/eslint/no_useless_rename.rs @@ -60,6 +60,7 @@ declare_oxc_lint!( /// export { baz }; /// ``` NoUselessRename, + eslint, correctness ); @@ -397,5 +398,5 @@ fn test() { ), ]; - Tester::new(NoUselessRename::NAME, NoUselessRename::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoUselessRename::NAME, NoUselessRename::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_var.rs b/crates/oxc_linter/src/rules/eslint/no_var.rs index cd33b1138b29d..978c70c3d3187 100644 --- a/crates/oxc_linter/src/rules/eslint/no_var.rs +++ b/crates/oxc_linter/src/rules/eslint/no_var.rs @@ -43,6 +43,7 @@ declare_oxc_lint!( /// const CONFIG = {}; /// ``` NoVar, + eslint, restriction, fix ); @@ -158,5 +159,5 @@ fn test() { ("var { a } = {}; let b = a", "const { a } = {}; let b = a"), ]; - Tester::new(NoVar::NAME, NoVar::CATEGORY, pass, fail).expect_fix(fix).test_and_snapshot(); + Tester::new(NoVar::NAME, NoVar::PLUGIN, pass, fail).expect_fix(fix).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_void.rs b/crates/oxc_linter/src/rules/eslint/no_void.rs index 995aa223ed4b8..6083f9937b407 100644 --- a/crates/oxc_linter/src/rules/eslint/no_void.rs +++ b/crates/oxc_linter/src/rules/eslint/no_void.rs @@ -41,6 +41,7 @@ declare_oxc_lint!( /// "foo.void = bar"; /// ``` NoVoid, + eslint, restriction, pending // TODO: suggestion ); @@ -98,5 +99,5 @@ fn test() { ("var foo = void 0", Some(serde_json::json!([{ "allowAsStatement": true }]))), ]; - Tester::new(NoVoid::NAME, NoVoid::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoVoid::NAME, NoVoid::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/no_with.rs b/crates/oxc_linter/src/rules/eslint/no_with.rs index e64d9e704af12..c4d72a7b269f3 100644 --- a/crates/oxc_linter/src/rules/eslint/no_with.rs +++ b/crates/oxc_linter/src/rules/eslint/no_with.rs @@ -28,6 +28,7 @@ declare_oxc_lint!( /// } /// ``` NoWith, + eslint, correctness ); @@ -50,5 +51,5 @@ fn test() { let fail = vec!["with(foo) { bar() }"]; - Tester::new(NoWith::NAME, NoWith::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoWith::NAME, NoWith::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/prefer_exponentiation_operator.rs b/crates/oxc_linter/src/rules/eslint/prefer_exponentiation_operator.rs index 0142711df6c8b..a0df0a0740c44 100644 --- a/crates/oxc_linter/src/rules/eslint/prefer_exponentiation_operator.rs +++ b/crates/oxc_linter/src/rules/eslint/prefer_exponentiation_operator.rs @@ -31,6 +31,7 @@ declare_oxc_lint!( /// Math.pow(a, b) /// ``` PreferExponentiationOperator, + eslint, style, ); @@ -126,7 +127,7 @@ fn test() { Tester::new( PreferExponentiationOperator::NAME, - PreferExponentiationOperator::CATEGORY, + PreferExponentiationOperator::PLUGIN, pass, fail, ) diff --git a/crates/oxc_linter/src/rules/eslint/prefer_numeric_literals.rs b/crates/oxc_linter/src/rules/eslint/prefer_numeric_literals.rs index 42220705ec3c2..c0545ef3566ed 100644 --- a/crates/oxc_linter/src/rules/eslint/prefer_numeric_literals.rs +++ b/crates/oxc_linter/src/rules/eslint/prefer_numeric_literals.rs @@ -53,6 +53,7 @@ declare_oxc_lint!( /// Number.parseInt("1F7", 16) === 503; /// ``` PreferNumericLiterals, + eslint, style, conditional_fix ); @@ -375,7 +376,7 @@ fn test() { (r#"(Number?.parseInt)?.("1F7", 16) === 255;"#, "0x1F7 === 255;", None), ]; - Tester::new(PreferNumericLiterals::NAME, PreferNumericLiterals::CATEGORY, pass, fail) + Tester::new(PreferNumericLiterals::NAME, PreferNumericLiterals::PLUGIN, pass, fail) .expect_fix(fix) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/prefer_object_has_own.rs b/crates/oxc_linter/src/rules/eslint/prefer_object_has_own.rs index 92011949b7467..e6ad84fdb1fd3 100644 --- a/crates/oxc_linter/src/rules/eslint/prefer_object_has_own.rs +++ b/crates/oxc_linter/src/rules/eslint/prefer_object_has_own.rs @@ -54,6 +54,7 @@ declare_oxc_lint!( /// const hasProperty = Object.hasOwn(object, property); /// ``` PreferObjectHasOwn, + eslint, style, conditional_fix ); @@ -381,7 +382,7 @@ fn test() { // Issue: ("…Object.prototype.hasOwnProperty.call(C,x);", "… Object.hasOwn(C,x);", None), ]; - Tester::new(PreferObjectHasOwn::NAME, PreferObjectHasOwn::CATEGORY, pass, fail) + Tester::new(PreferObjectHasOwn::NAME, PreferObjectHasOwn::PLUGIN, pass, fail) .expect_fix(fix) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/prefer_rest_params.rs b/crates/oxc_linter/src/rules/eslint/prefer_rest_params.rs index f7807fc8fba51..e13f440d9991f 100644 --- a/crates/oxc_linter/src/rules/eslint/prefer_rest_params.rs +++ b/crates/oxc_linter/src/rules/eslint/prefer_rest_params.rs @@ -60,6 +60,7 @@ declare_oxc_lint!( /// } /// ``` PreferRestParams, + eslint, style, ); @@ -122,5 +123,5 @@ fn test() { "function foo() { arguments[Symbol.iterator]; }", ]; - Tester::new(PreferRestParams::NAME, PreferRestParams::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(PreferRestParams::NAME, PreferRestParams::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/prefer_spread.rs b/crates/oxc_linter/src/rules/eslint/prefer_spread.rs index b91dac4895148..e024538b5aba5 100644 --- a/crates/oxc_linter/src/rules/eslint/prefer_spread.rs +++ b/crates/oxc_linter/src/rules/eslint/prefer_spread.rs @@ -102,6 +102,7 @@ declare_oxc_lint!( /// Array.from(...argumentsArray); /// ``` PreferSpread, + eslint, style, conditional_fix ); @@ -635,7 +636,7 @@ fn test() { (r#""foo bar baz".split("")"#, r#"[..."foo bar baz"]"#, None), ]; - Tester::new(PreferSpread::NAME, PreferSpread::CATEGORY, pass, fail) + Tester::new(PreferSpread::NAME, PreferSpread::PLUGIN, pass, fail) .expect_fix(expect_fix) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/radix.rs b/crates/oxc_linter/src/rules/eslint/radix.rs index ba6cda1d489d9..83f928f5444f8 100644 --- a/crates/oxc_linter/src/rules/eslint/radix.rs +++ b/crates/oxc_linter/src/rules/eslint/radix.rs @@ -51,6 +51,7 @@ declare_oxc_lint!( /// var num = parseInt("071", 10); // 71 /// ``` Radix, + eslint, pedantic ); @@ -226,5 +227,5 @@ fn test() { ("{ let Number; } (Number?.parseInt)();", None), ]; - Tester::new(Radix::NAME, Radix::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(Radix::NAME, Radix::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/require_await.rs b/crates/oxc_linter/src/rules/eslint/require_await.rs index cbf949ee1789e..5538693243dee 100644 --- a/crates/oxc_linter/src/rules/eslint/require_await.rs +++ b/crates/oxc_linter/src/rules/eslint/require_await.rs @@ -68,6 +68,7 @@ declare_oxc_lint!( /// } /// ``` RequireAwait, + eslint, pedantic, ); @@ -208,5 +209,5 @@ fn test() { "async function foo() { await (async () => { doSomething() }) }", ]; - Tester::new(RequireAwait::NAME, RequireAwait::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(RequireAwait::NAME, RequireAwait::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/require_yield.rs b/crates/oxc_linter/src/rules/eslint/require_yield.rs index 11d01f195413b..da9d19924b076 100644 --- a/crates/oxc_linter/src/rules/eslint/require_yield.rs +++ b/crates/oxc_linter/src/rules/eslint/require_yield.rs @@ -28,6 +28,7 @@ declare_oxc_lint!( /// } /// ``` RequireYield, + eslint, correctness ); @@ -72,5 +73,5 @@ fn test() { "function* foo() { function* bar() { return 0; } yield 0; }", ]; - Tester::new(RequireYield::NAME, RequireYield::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(RequireYield::NAME, RequireYield::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/sort_imports.rs b/crates/oxc_linter/src/rules/eslint/sort_imports.rs index 5cc6679a86b86..f7d9b3b1e6d54 100644 --- a/crates/oxc_linter/src/rules/eslint/sort_imports.rs +++ b/crates/oxc_linter/src/rules/eslint/sort_imports.rs @@ -75,6 +75,7 @@ declare_oxc_lint!( /// import e from 'bar.js'; /// ``` SortImports, + eslint, style, conditional_fix ); @@ -828,7 +829,7 @@ fn test() { None, ), ]; - Tester::new(SortImports::NAME, SortImports::CATEGORY, pass, fail) + Tester::new(SortImports::NAME, SortImports::PLUGIN, pass, fail) .expect_fix(fix) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/sort_keys.rs b/crates/oxc_linter/src/rules/eslint/sort_keys.rs index 6ecdecb797e00..a84a5ee51ad09 100644 --- a/crates/oxc_linter/src/rules/eslint/sort_keys.rs +++ b/crates/oxc_linter/src/rules/eslint/sort_keys.rs @@ -82,6 +82,7 @@ declare_oxc_lint!( /// }; /// ``` SortKeys, + eslint, style, pending ); @@ -1023,5 +1024,5 @@ fn test() { ), // { "ecmaVersion": 2018 } ]; - Tester::new(SortKeys::NAME, SortKeys::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(SortKeys::NAME, SortKeys::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/sort_vars.rs b/crates/oxc_linter/src/rules/eslint/sort_vars.rs index 2281684da2956..450b1954b16fd 100644 --- a/crates/oxc_linter/src/rules/eslint/sort_vars.rs +++ b/crates/oxc_linter/src/rules/eslint/sort_vars.rs @@ -44,6 +44,7 @@ declare_oxc_lint!( /// var B, a, c; /// ``` SortVars, + eslint, pedantic, pending ); @@ -222,5 +223,5 @@ fn test() { ("var {} = 1, b, a", "var {} = 1, a, b", Some(serde_json::json!([{ "ignoreCase": true }]))), ]; - Tester::new(SortVars::NAME, SortVars::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(SortVars::NAME, SortVars::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/symbol_description.rs b/crates/oxc_linter/src/rules/eslint/symbol_description.rs index d7bc60739c8a7..2a2a93ebc1132 100644 --- a/crates/oxc_linter/src/rules/eslint/symbol_description.rs +++ b/crates/oxc_linter/src/rules/eslint/symbol_description.rs @@ -43,6 +43,7 @@ declare_oxc_lint!( /// /// SymbolDescription, + eslint, pedantic, ); @@ -80,6 +81,5 @@ fn test() { let fail = vec!["Symbol();", "Symbol(); Symbol = function () {};"]; - Tester::new(SymbolDescription::NAME, SymbolDescription::CATEGORY, pass, fail) - .test_and_snapshot(); + Tester::new(SymbolDescription::NAME, SymbolDescription::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/unicode_bom.rs b/crates/oxc_linter/src/rules/eslint/unicode_bom.rs index dced56d0a8219..41089931e9bb9 100644 --- a/crates/oxc_linter/src/rules/eslint/unicode_bom.rs +++ b/crates/oxc_linter/src/rules/eslint/unicode_bom.rs @@ -39,6 +39,7 @@ declare_oxc_lint!( /// var a = 123; /// ``` UnicodeBom, + eslint, restriction, fix ); @@ -116,7 +117,7 @@ fn test() { ("var a = 123;", "var a = 123;", Some(serde_json::json!(["always"]))), ]; - Tester::new(UnicodeBom::NAME, UnicodeBom::CATEGORY, pass, fail) + Tester::new(UnicodeBom::NAME, UnicodeBom::PLUGIN, pass, fail) .expect_fix(fix) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/use_isnan.rs b/crates/oxc_linter/src/rules/eslint/use_isnan.rs index cd17c5f73ef4a..f4f428ba74834 100644 --- a/crates/oxc_linter/src/rules/eslint/use_isnan.rs +++ b/crates/oxc_linter/src/rules/eslint/use_isnan.rs @@ -74,6 +74,7 @@ declare_oxc_lint!( /// foo > NaN; /// ``` UseIsnan, + eslint, correctness, conditional_fix ); @@ -540,5 +541,5 @@ fn test() { ("1 !== Number.NaN", "!isNaN(1)", None), ]; - Tester::new(UseIsnan::NAME, UseIsnan::CATEGORY, pass, fail).expect_fix(fix).test_and_snapshot(); + Tester::new(UseIsnan::NAME, UseIsnan::PLUGIN, pass, fail).expect_fix(fix).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/valid_typeof.rs b/crates/oxc_linter/src/rules/eslint/valid_typeof.rs index b4d5612e3bdad..2f2532945b298 100644 --- a/crates/oxc_linter/src/rules/eslint/valid_typeof.rs +++ b/crates/oxc_linter/src/rules/eslint/valid_typeof.rs @@ -51,6 +51,7 @@ declare_oxc_lint!( /// typeof foo === baz /// ``` ValidTypeof, + eslint, correctness, conditional_fix ); @@ -224,7 +225,7 @@ fn test() { let fix = vec![("typeof foo === undefined", r#"typeof foo === "undefined""#)]; - Tester::new(ValidTypeof::NAME, ValidTypeof::CATEGORY, pass, fail) + Tester::new(ValidTypeof::NAME, ValidTypeof::PLUGIN, pass, fail) .expect_fix(fix) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/vars_on_top.rs b/crates/oxc_linter/src/rules/eslint/vars_on_top.rs index b2d4226262f69..60bed7cb0215b 100644 --- a/crates/oxc_linter/src/rules/eslint/vars_on_top.rs +++ b/crates/oxc_linter/src/rules/eslint/vars_on_top.rs @@ -87,6 +87,7 @@ declare_oxc_lint!( /// } /// ``` VarsOnTop, + eslint, style, ); @@ -540,5 +541,5 @@ fn test() { }", // { "ecmaVersion": 2022 } ]; - Tester::new(VarsOnTop::NAME, VarsOnTop::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(VarsOnTop::NAME, VarsOnTop::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/eslint/yoda.rs b/crates/oxc_linter/src/rules/eslint/yoda.rs index 19efb31b52def..36089ba0c7971 100644 --- a/crates/oxc_linter/src/rules/eslint/yoda.rs +++ b/crates/oxc_linter/src/rules/eslint/yoda.rs @@ -184,6 +184,7 @@ declare_oxc_lint!( /// } /// ``` Yoda, + eslint, style, fix ); @@ -1165,5 +1166,5 @@ fn test() { ), ]; - Tester::new(Yoda::NAME, Yoda::CATEGORY, pass, fail).expect_fix(fix).test_and_snapshot(); + Tester::new(Yoda::NAME, Yoda::PLUGIN, pass, fail).expect_fix(fix).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/import/default.rs b/crates/oxc_linter/src/rules/import/default.rs index aca5812cc23ba..8dd7dcd7a10ca 100644 --- a/crates/oxc_linter/src/rules/import/default.rs +++ b/crates/oxc_linter/src/rules/import/default.rs @@ -47,6 +47,7 @@ declare_oxc_lint!( /// import { bar } from './bar' // correct usage of named import /// ``` Default, + import, correctness ); @@ -149,7 +150,7 @@ fn test() { // r#"import Foo from "./typescript-export-as-default-namespace""#, ]; - Tester::new(Default::NAME, Default::CATEGORY, pass, fail) + Tester::new(Default::NAME, Default::PLUGIN, pass, fail) .change_rule_path("index.js") .with_import_plugin(true) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/import/export.rs b/crates/oxc_linter/src/rules/import/export.rs index 908ef15956408..d493bcabac987 100644 --- a/crates/oxc_linter/src/rules/import/export.rs +++ b/crates/oxc_linter/src/rules/import/export.rs @@ -44,6 +44,8 @@ declare_oxc_lint!( /// export * from "./export-all"; // No conflict if export-all.js also exports foo /// ``` Export, + + import, nursery ); @@ -338,7 +340,7 @@ fn test() { // "), ]; - Tester::new(Export::NAME, Export::CATEGORY, pass, fail) + Tester::new(Export::NAME, Export::PLUGIN, pass, fail) .with_import_plugin(true) .change_rule_path("index.ts") .test_and_snapshot(); @@ -354,7 +356,7 @@ fn test() { export {Baz as default}; "), ]; - Tester::new(Export::NAME, Export::CATEGORY, pass, fail) + Tester::new(Export::NAME, Export::PLUGIN, pass, fail) .with_import_plugin(true) .change_rule_path("export-star-4/index.js") .test(); diff --git a/crates/oxc_linter/src/rules/import/first.rs b/crates/oxc_linter/src/rules/import/first.rs index 7c14a65944842..d1aa9a094470f 100644 --- a/crates/oxc_linter/src/rules/import/first.rs +++ b/crates/oxc_linter/src/rules/import/first.rs @@ -88,6 +88,7 @@ declare_oxc_lint!( /// ``` /// First, + import, style, pending // TODO: fixer ); @@ -229,7 +230,7 @@ fn test() { ), ]; - Tester::new(First::NAME, First::CATEGORY, pass, fail) + Tester::new(First::NAME, First::PLUGIN, pass, fail) .change_rule_path("index.ts") .with_import_plugin(true) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/import/max_dependencies.rs b/crates/oxc_linter/src/rules/import/max_dependencies.rs index a6f6912d262f7..7b23476aec105 100644 --- a/crates/oxc_linter/src/rules/import/max_dependencies.rs +++ b/crates/oxc_linter/src/rules/import/max_dependencies.rs @@ -68,6 +68,7 @@ declare_oxc_lint!( /// import b from './b'; // Allowed: 2 dependencies (max: 2) /// ``` MaxDependencies, + import, pedantic, ); @@ -207,7 +208,7 @@ fn test() { ), ]; - Tester::new(MaxDependencies::NAME, MaxDependencies::CATEGORY, pass, fail) + Tester::new(MaxDependencies::NAME, MaxDependencies::PLUGIN, pass, fail) .change_rule_path("index.ts") .with_import_plugin(true) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/import/named.rs b/crates/oxc_linter/src/rules/import/named.rs index c3859b7bc4093..1d69bcf215ac0 100644 --- a/crates/oxc_linter/src/rules/import/named.rs +++ b/crates/oxc_linter/src/rules/import/named.rs @@ -77,6 +77,7 @@ declare_oxc_lint!( /// import { SomeNonsenseThatDoesntExist } from 'react' /// ``` Named, + import, nursery // There are race conditions in the runtime which may cause the module to // not find any exports from `exported_bindings_from_star_export`. ); @@ -271,7 +272,7 @@ fn test() { "import { FooBar } from './typescript-export-assign-object'", ]; - Tester::new(Named::NAME, Named::CATEGORY, pass, fail) + Tester::new(Named::NAME, Named::PLUGIN, pass, fail) .change_rule_path("index.js") .with_import_plugin(true) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/import/namespace.rs b/crates/oxc_linter/src/rules/import/namespace.rs index 5e84692fd8fde..e1a2d1e17c6cc 100644 --- a/crates/oxc_linter/src/rules/import/namespace.rs +++ b/crates/oxc_linter/src/rules/import/namespace.rs @@ -102,6 +102,7 @@ declare_oxc_lint!( /// foo[method](); // Valid: method refers to an exported function /// ``` Namespace, + import, correctness ); @@ -516,7 +517,7 @@ fn test() { (r#"import * as a from "./deep-es7/a"; var {b:{c:{ e }, e: { c }}} = a"#, None), ]; - Tester::new(Namespace::NAME, Namespace::CATEGORY, pass, fail) + Tester::new(Namespace::NAME, Namespace::PLUGIN, pass, fail) .change_rule_path("index.js") .with_import_plugin(true) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/import/no_amd.rs b/crates/oxc_linter/src/rules/import/no_amd.rs index d27298cebbbdd..d49201f8c090f 100644 --- a/crates/oxc_linter/src/rules/import/no_amd.rs +++ b/crates/oxc_linter/src/rules/import/no_amd.rs @@ -44,6 +44,7 @@ declare_oxc_lint!( /// require(`../name`); /// ``` NoAmd, + import, restriction ); @@ -112,7 +113,7 @@ fn test() { r#"require(["a"], function(a) { console.log(a); })"#, ]; - Tester::new(NoAmd::NAME, NoAmd::CATEGORY, pass, fail) + Tester::new(NoAmd::NAME, NoAmd::PLUGIN, pass, fail) .change_rule_path("no-amd.js") .with_import_plugin(true) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/import/no_commonjs.rs b/crates/oxc_linter/src/rules/import/no_commonjs.rs index 71ea54a0d669c..646ea9d38a565 100644 --- a/crates/oxc_linter/src/rules/import/no_commonjs.rs +++ b/crates/oxc_linter/src/rules/import/no_commonjs.rs @@ -105,6 +105,7 @@ declare_oxc_lint!( /// ``` /// NoCommonjs, + import, restriction ); @@ -339,7 +340,7 @@ fn test() { (r"var x = module.exports", Some(json!([{ "allowPrimitiveModules": true }]))), ]; - Tester::new(NoCommonjs::NAME, NoCommonjs::CATEGORY, pass, fail) + Tester::new(NoCommonjs::NAME, NoCommonjs::PLUGIN, pass, fail) .change_rule_path("index.js") .with_import_plugin(true) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/import/no_cycle.rs b/crates/oxc_linter/src/rules/import/no_cycle.rs index 1d5a744253c68..8ac0036e6cbbb 100644 --- a/crates/oxc_linter/src/rules/import/no_cycle.rs +++ b/crates/oxc_linter/src/rules/import/no_cycle.rs @@ -88,6 +88,7 @@ declare_oxc_lint!( /// /// In this corrected version, `dep-b.js` no longer imports `dep-a.js`, breaking the cycle. NoCycle, + import, restriction ); @@ -364,7 +365,7 @@ fn test() { ), ]; - Tester::new(NoCycle::NAME, NoCycle::CATEGORY, pass, fail) + Tester::new(NoCycle::NAME, NoCycle::PLUGIN, pass, fail) .change_rule_path("cycles/depth-zero.js") .with_import_plugin(true) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/import/no_default_export.rs b/crates/oxc_linter/src/rules/import/no_default_export.rs index d4bb993d17c2e..f29fb6458f380 100644 --- a/crates/oxc_linter/src/rules/import/no_default_export.rs +++ b/crates/oxc_linter/src/rules/import/no_default_export.rs @@ -40,6 +40,7 @@ declare_oxc_lint!( /// export const bar = 'bar'; /// ``` NoDefaultExport, + import, restriction ); @@ -86,7 +87,7 @@ fn test() { // "export default from \"foo.js\"", ]; - Tester::new(NoDefaultExport::NAME, NoDefaultExport::CATEGORY, pass, fail) + Tester::new(NoDefaultExport::NAME, NoDefaultExport::PLUGIN, pass, fail) .with_import_plugin(true) .change_rule_path("index.ts") .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/import/no_deprecated.rs b/crates/oxc_linter/src/rules/import/no_deprecated.rs index 2d0bb58ebf607..ae776c6ff03cb 100644 --- a/crates/oxc_linter/src/rules/import/no_deprecated.rs +++ b/crates/oxc_linter/src/rules/import/no_deprecated.rs @@ -34,6 +34,7 @@ declare_oxc_lint!( /// ```javascript /// ``` NoDeprecated, + import, nursery ); @@ -109,7 +110,7 @@ fn test() { // r#"import { foo } from "./ts-deprecated.ts"; console.log(foo())"#, ]; - Tester::new(NoDeprecated::NAME, NoDeprecated::CATEGORY, pass, fail) + Tester::new(NoDeprecated::NAME, NoDeprecated::PLUGIN, pass, fail) .change_rule_path("index.js") .with_import_plugin(true) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/import/no_duplicates.rs b/crates/oxc_linter/src/rules/import/no_duplicates.rs index f083f5abf4145..9080f26211cfb 100644 --- a/crates/oxc_linter/src/rules/import/no_duplicates.rs +++ b/crates/oxc_linter/src/rules/import/no_duplicates.rs @@ -75,6 +75,7 @@ declare_oxc_lint!( /// import type { d } from 'foo'; // `preferInline` is true /// ``` NoDuplicates, + import, suspicious ); @@ -409,7 +410,7 @@ fn test() { ), ]; - Tester::new(NoDuplicates::NAME, NoDuplicates::CATEGORY, pass, fail) + Tester::new(NoDuplicates::NAME, NoDuplicates::PLUGIN, pass, fail) .change_rule_path("index.ts") .with_import_plugin(true) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/import/no_dynamic_require.rs b/crates/oxc_linter/src/rules/import/no_dynamic_require.rs index 3386efebefd8b..affbd6ce6a3c4 100644 --- a/crates/oxc_linter/src/rules/import/no_dynamic_require.rs +++ b/crates/oxc_linter/src/rules/import/no_dynamic_require.rs @@ -43,6 +43,7 @@ declare_oxc_lint!( /// require(`../name`); /// ``` NoDynamicRequire, + import, restriction, ); @@ -136,5 +137,5 @@ fn test() { ("import(name())", Some(json!([{ "esmodule": true }]))), ]; - Tester::new(NoDynamicRequire::NAME, NoDynamicRequire::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoDynamicRequire::NAME, NoDynamicRequire::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/import/no_named_as_default.rs b/crates/oxc_linter/src/rules/import/no_named_as_default.rs index 9300b19a609af..d7ca89ba80eb3 100644 --- a/crates/oxc_linter/src/rules/import/no_named_as_default.rs +++ b/crates/oxc_linter/src/rules/import/no_named_as_default.rs @@ -54,6 +54,7 @@ declare_oxc_lint!( /// import foo from './foo.js'; /// ``` NoNamedAsDefault, + import, suspicious ); @@ -106,7 +107,7 @@ fn test() { r#"import foo, { foo as bar } from "./export-default-string-and-named""#, ]; - Tester::new(NoNamedAsDefault::NAME, NoNamedAsDefault::CATEGORY, pass, fail) + Tester::new(NoNamedAsDefault::NAME, NoNamedAsDefault::PLUGIN, pass, fail) .change_rule_path("index.js") .with_import_plugin(true) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/import/no_named_as_default_member.rs b/crates/oxc_linter/src/rules/import/no_named_as_default_member.rs index 4c68099672997..2b29c3b0b8566 100644 --- a/crates/oxc_linter/src/rules/import/no_named_as_default_member.rs +++ b/crates/oxc_linter/src/rules/import/no_named_as_default_member.rs @@ -63,6 +63,7 @@ declare_oxc_lint!( /// import { bar } from './bar'; // Correct: accessing named export directly /// ``` NoNamedAsDefaultMember, + import, suspicious ); @@ -208,7 +209,7 @@ fn test() { r#"import baz from "./named-and-default-export"; const {foo: _foo} = baz"#, ]; - Tester::new(NoNamedAsDefaultMember::NAME, NoNamedAsDefaultMember::CATEGORY, pass, fail) + Tester::new(NoNamedAsDefaultMember::NAME, NoNamedAsDefaultMember::PLUGIN, pass, fail) .change_rule_path("index.js") .with_import_plugin(true) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/import/no_named_default.rs b/crates/oxc_linter/src/rules/import/no_named_default.rs index 94d3345d5fd92..b9755e56a8cf1 100644 --- a/crates/oxc_linter/src/rules/import/no_named_default.rs +++ b/crates/oxc_linter/src/rules/import/no_named_default.rs @@ -35,6 +35,7 @@ declare_oxc_lint!( /// import foo, { bar } from './foo.js'; /// ``` NoNamedDefault, + import, style, ); @@ -67,5 +68,5 @@ fn test() { r#"import { "default" as bar } from "./bar";"#, ]; - Tester::new(NoNamedDefault::NAME, NoNamedDefault::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoNamedDefault::NAME, NoNamedDefault::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/import/no_namespace.rs b/crates/oxc_linter/src/rules/import/no_namespace.rs index ddf15b2d15271..81b7d59b7b705 100644 --- a/crates/oxc_linter/src/rules/import/no_namespace.rs +++ b/crates/oxc_linter/src/rules/import/no_namespace.rs @@ -77,6 +77,7 @@ declare_oxc_lint!( /// ``` /// NoNamespace, + import, style, pending // TODO: fixer ); @@ -156,7 +157,7 @@ fn test() { (r"import * as foo from './foo';", None), ]; - Tester::new(NoNamespace::NAME, NoNamespace::CATEGORY, pass, fail) + Tester::new(NoNamespace::NAME, NoNamespace::PLUGIN, pass, fail) .change_rule_path("index.js") .with_import_plugin(true) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/import/no_self_import.rs b/crates/oxc_linter/src/rules/import/no_self_import.rs index c991f9985154c..217d945617d8a 100644 --- a/crates/oxc_linter/src/rules/import/no_self_import.rs +++ b/crates/oxc_linter/src/rules/import/no_self_import.rs @@ -37,6 +37,7 @@ declare_oxc_lint!( /// import bar from './bar.js'; // Correct: module imports another module /// ``` NoSelfImport, + import, suspicious ); @@ -87,7 +88,7 @@ fn test() { // "var bar = require('./no-self-import.js')", ]; - Tester::new(NoSelfImport::NAME, NoSelfImport::CATEGORY, pass, fail) + Tester::new(NoSelfImport::NAME, NoSelfImport::PLUGIN, pass, fail) .with_import_plugin(true) .change_rule_path("no-self-import.js") .test(); @@ -97,7 +98,7 @@ fn test() { // let pass = vec!["var bar = require('./bar')"]; // let fail = vec![]; - // Tester::new(NoSelfImport::NAME, NoSelfImport::CATEGORY, pass, fail) + // Tester::new(NoSelfImport::NAME, NoSelfImport::PLUGIN, pass, fail) // .with_import_plugin(true) // .change_rule_path("bar/index.js") // .test(); @@ -111,7 +112,7 @@ fn test() { // "var bar = require('././././')", // ]; - // Tester::new(NoSelfImport::NAME, NoSelfImport::CATEGORY, pass, fail) + // Tester::new(NoSelfImport::NAME, NoSelfImport::PLUGIN, pass, fail) // .with_import_plugin(true) // .change_rule_path("index.js") // .test(); @@ -121,7 +122,7 @@ fn test() { // let pass = vec![]; // let fail = vec!["var bar = require('../no-self-import-folder')"]; - // Tester::new(NoSelfImport::NAME, NoSelfImport::CATEGORY, pass, fail) + // Tester::new(NoSelfImport::NAME, NoSelfImport::PLUGIN, pass, fail) // .with_import_plugin(true) // .change_rule_path("no-self-import-folder/index.js") // .test(); diff --git a/crates/oxc_linter/src/rules/import/no_unused_modules.rs b/crates/oxc_linter/src/rules/import/no_unused_modules.rs index eed6e5bb1cafa..5b8bb51784ace 100644 --- a/crates/oxc_linter/src/rules/import/no_unused_modules.rs +++ b/crates/oxc_linter/src/rules/import/no_unused_modules.rs @@ -37,6 +37,7 @@ declare_oxc_lint!( /// ```javascript /// ``` NoUnusedModules, + import, nursery ); @@ -103,7 +104,7 @@ fn test() { ("/* const a = 1 */", Some(missing_exports_options.clone())), ]; - Tester::new(NoUnusedModules::NAME, NoUnusedModules::CATEGORY, pass, fail) + Tester::new(NoUnusedModules::NAME, NoUnusedModules::PLUGIN, pass, fail) .change_rule_path("missing-exports.js") .with_import_plugin(true) .test_and_snapshot(); @@ -122,7 +123,7 @@ fn test() { // let fail = vec![]; - // Tester::new(NoUnusedModules::NAME, NoUnusedModules::CATEGORY, pass, fail) + // Tester::new(NoUnusedModules::NAME, NoUnusedModules::PLUGIN, pass, fail) // .change_rule_path("unused-exports.js") // .with_import_plugin(true) // .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/import/no_webpack_loader_syntax.rs b/crates/oxc_linter/src/rules/import/no_webpack_loader_syntax.rs index 709f9949f9eb7..ff74f0279d3fe 100644 --- a/crates/oxc_linter/src/rules/import/no_webpack_loader_syntax.rs +++ b/crates/oxc_linter/src/rules/import/no_webpack_loader_syntax.rs @@ -48,6 +48,7 @@ declare_oxc_lint!( /// var theme = require('./theme.css'); /// ``` NoWebpackLoaderSyntax, + import, restriction, ); @@ -123,6 +124,6 @@ fn test() { "var data = require('json!@scope/my-package/data.json')", ]; - Tester::new(NoWebpackLoaderSyntax::NAME, NoWebpackLoaderSyntax::CATEGORY, pass, fail) + Tester::new(NoWebpackLoaderSyntax::NAME, NoWebpackLoaderSyntax::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/import/unambiguous.rs b/crates/oxc_linter/src/rules/import/unambiguous.rs index 3c1e08ae91abd..d9cd0cf4c24b4 100644 --- a/crates/oxc_linter/src/rules/import/unambiguous.rs +++ b/crates/oxc_linter/src/rules/import/unambiguous.rs @@ -42,6 +42,7 @@ declare_oxc_lint!( /// export {} // simple way to mark side-effects-only file as 'module' without any imports/exports /// ``` Unambiguous, + import, restriction ); @@ -75,7 +76,7 @@ fn test() { let fail = vec![r"function x() {}", r"(function x() { return 42 })()"]; - Tester::new(Unambiguous::NAME, Unambiguous::CATEGORY, pass, fail) + Tester::new(Unambiguous::NAME, Unambiguous::PLUGIN, pass, fail) .change_rule_path("index.ts") .with_import_plugin(true) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/consistent_test_it.rs b/crates/oxc_linter/src/rules/jest/consistent_test_it.rs index bf8e54a452869..1e5cecaca7c0f 100644 --- a/crates/oxc_linter/src/rules/jest/consistent_test_it.rs +++ b/crates/oxc_linter/src/rules/jest/consistent_test_it.rs @@ -172,6 +172,7 @@ declare_oxc_lint!( /// } /// } ConsistentTestIt, + jest, style, fix ); @@ -917,7 +918,7 @@ fn test() { fail.extend(fail_vitest); fix.extend(fix_vitest); - Tester::new(ConsistentTestIt::NAME, ConsistentTestIt::CATEGORY, pass, fail) + Tester::new(ConsistentTestIt::NAME, ConsistentTestIt::PLUGIN, pass, fail) .with_jest_plugin(true) .with_vitest_plugin(true) .expect_fix(fix) diff --git a/crates/oxc_linter/src/rules/jest/expect_expect.rs b/crates/oxc_linter/src/rules/jest/expect_expect.rs index 6b2f528dc6207..3daba58465853 100644 --- a/crates/oxc_linter/src/rules/jest/expect_expect.rs +++ b/crates/oxc_linter/src/rules/jest/expect_expect.rs @@ -86,6 +86,7 @@ declare_oxc_lint!( /// } /// ``` ExpectExpect, + jest, correctness ); @@ -840,7 +841,7 @@ fn test() { pass.extend(pass_vitest); fail.extend(fail_vitest); - Tester::new(ExpectExpect::NAME, ExpectExpect::CATEGORY, pass, fail) + Tester::new(ExpectExpect::NAME, ExpectExpect::PLUGIN, pass, fail) .with_jest_plugin(true) .with_vitest_plugin(true) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/max_expects.rs b/crates/oxc_linter/src/rules/jest/max_expects.rs index 0a5fe68352dba..4f7aed21868cf 100644 --- a/crates/oxc_linter/src/rules/jest/max_expects.rs +++ b/crates/oxc_linter/src/rules/jest/max_expects.rs @@ -61,6 +61,7 @@ declare_oxc_lint!( /// }); /// ``` MaxExpects, + jest, style, ); @@ -470,7 +471,7 @@ fn test() { ), ]; - Tester::new(MaxExpects::NAME, MaxExpects::CATEGORY, pass, fail) + Tester::new(MaxExpects::NAME, MaxExpects::PLUGIN, pass, fail) .with_jest_plugin(true) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jest/max_nested_describe.rs b/crates/oxc_linter/src/rules/jest/max_nested_describe.rs index 5eb5dd957b3d9..6f181bd1f5d69 100644 --- a/crates/oxc_linter/src/rules/jest/max_nested_describe.rs +++ b/crates/oxc_linter/src/rules/jest/max_nested_describe.rs @@ -117,6 +117,7 @@ declare_oxc_lint!( /// ``` /// MaxNestedDescribe, + jest, style, ); @@ -396,7 +397,7 @@ fn test() { ), ]; - Tester::new(MaxNestedDescribe::NAME, MaxNestedDescribe::CATEGORY, pass, fail) + Tester::new(MaxNestedDescribe::NAME, MaxNestedDescribe::PLUGIN, pass, fail) .with_jest_plugin(true) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jest/no_alias_methods.rs b/crates/oxc_linter/src/rules/jest/no_alias_methods.rs index d792a46b6478c..806e95343d156 100644 --- a/crates/oxc_linter/src/rules/jest/no_alias_methods.rs +++ b/crates/oxc_linter/src/rules/jest/no_alias_methods.rs @@ -54,6 +54,7 @@ declare_oxc_lint!( /// } /// ``` NoAliasMethods, + jest, style, fix ); @@ -226,7 +227,7 @@ fn test() { fail.extend(fail_vitest.into_iter().map(|x| (x, None))); fix.extend(fix_vitest); - Tester::new(NoAliasMethods::NAME, NoAliasMethods::CATEGORY, pass, fail) + Tester::new(NoAliasMethods::NAME, NoAliasMethods::PLUGIN, pass, fail) .with_jest_plugin(true) .with_vitest_plugin(true) .expect_fix(fix) diff --git a/crates/oxc_linter/src/rules/jest/no_commented_out_tests.rs b/crates/oxc_linter/src/rules/jest/no_commented_out_tests.rs index fd4a9d7ccfcd9..88941bc2d6c11 100644 --- a/crates/oxc_linter/src/rules/jest/no_commented_out_tests.rs +++ b/crates/oxc_linter/src/rules/jest/no_commented_out_tests.rs @@ -49,6 +49,7 @@ declare_oxc_lint!( /// } /// ``` NoCommentedOutTests, + jest, suspicious ); @@ -217,7 +218,7 @@ fn test() { pass.extend(pass_vitest.into_iter().map(|x| (x, None))); fail.extend(fail_vitest.into_iter().map(|x| (x, None))); - Tester::new(NoCommentedOutTests::NAME, NoCommentedOutTests::CATEGORY, pass, fail) + Tester::new(NoCommentedOutTests::NAME, NoCommentedOutTests::PLUGIN, pass, fail) .with_jest_plugin(true) .with_vitest_plugin(true) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/no_conditional_expect.rs b/crates/oxc_linter/src/rules/jest/no_conditional_expect.rs index 75f096f4c49c6..2b537acfccd7d 100644 --- a/crates/oxc_linter/src/rules/jest/no_conditional_expect.rs +++ b/crates/oxc_linter/src/rules/jest/no_conditional_expect.rs @@ -62,6 +62,7 @@ declare_oxc_lint!( /// } /// ``` NoConditionalExpect, + jest, correctness ); @@ -998,7 +999,7 @@ fn test() { pass.extend(pass_vitest.into_iter().map(|x| (x, None))); fail.extend(fail_vitest.into_iter().map(|x| (x, None))); - Tester::new(NoConditionalExpect::NAME, NoConditionalExpect::CATEGORY, pass, fail) + Tester::new(NoConditionalExpect::NAME, NoConditionalExpect::PLUGIN, pass, fail) .with_jest_plugin(true) .with_vitest_plugin(true) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/no_conditional_in_test.rs b/crates/oxc_linter/src/rules/jest/no_conditional_in_test.rs index 1030320c3c77f..5fe77d1970db6 100644 --- a/crates/oxc_linter/src/rules/jest/no_conditional_in_test.rs +++ b/crates/oxc_linter/src/rules/jest/no_conditional_in_test.rs @@ -93,6 +93,7 @@ declare_oxc_lint!( /// }); /// ``` NoConditionalInTest, + jest, pedantic, ); @@ -644,7 +645,7 @@ fn test() { "#, ]; - Tester::new(NoConditionalInTest::NAME, NoConditionalInTest::CATEGORY, pass, fail) + Tester::new(NoConditionalInTest::NAME, NoConditionalInTest::PLUGIN, pass, fail) .with_jest_plugin(true) .with_vitest_plugin(true) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/no_confusing_set_timeout.rs b/crates/oxc_linter/src/rules/jest/no_confusing_set_timeout.rs index 8a1d01be7c017..87a9a8a9d78d9 100644 --- a/crates/oxc_linter/src/rules/jest/no_confusing_set_timeout.rs +++ b/crates/oxc_linter/src/rules/jest/no_confusing_set_timeout.rs @@ -71,6 +71,7 @@ declare_oxc_lint!( /// }); /// ``` NoConfusingSetTimeout, + jest, style ); @@ -484,7 +485,7 @@ fn test() { ), ]; - Tester::new(NoConfusingSetTimeout::NAME, NoConfusingSetTimeout::CATEGORY, pass, fail) + Tester::new(NoConfusingSetTimeout::NAME, NoConfusingSetTimeout::PLUGIN, pass, fail) .with_jest_plugin(true) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jest/no_deprecated_functions.rs b/crates/oxc_linter/src/rules/jest/no_deprecated_functions.rs index baa9ce19271c0..d0922db483ebc 100644 --- a/crates/oxc_linter/src/rules/jest/no_deprecated_functions.rs +++ b/crates/oxc_linter/src/rules/jest/no_deprecated_functions.rs @@ -73,6 +73,7 @@ declare_oxc_lint!( /// jest.addMatchers // since Jest 17 /// ``` NoDeprecatedFunctions, + jest, style, fix ); @@ -187,7 +188,7 @@ fn tests() { ), ]; - Tester::new(NoDeprecatedFunctions::NAME, NoDeprecatedFunctions::CATEGORY, pass, fail) + Tester::new(NoDeprecatedFunctions::NAME, NoDeprecatedFunctions::PLUGIN, pass, fail) .with_jest_plugin(true) .expect_fix(fix) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/no_disabled_tests.rs b/crates/oxc_linter/src/rules/jest/no_disabled_tests.rs index d2c4c2f970359..5648be519403c 100644 --- a/crates/oxc_linter/src/rules/jest/no_disabled_tests.rs +++ b/crates/oxc_linter/src/rules/jest/no_disabled_tests.rs @@ -60,6 +60,7 @@ declare_oxc_lint!( /// } /// ``` NoDisabledTests, + jest, correctness ); @@ -275,7 +276,7 @@ fn test() { pass.extend(pass_vitest.into_iter().map(|x| (x, None))); fail.extend(fail_vitest.into_iter().map(|x| (x, None))); - Tester::new(NoDisabledTests::NAME, NoDisabledTests::CATEGORY, pass, fail) + Tester::new(NoDisabledTests::NAME, NoDisabledTests::PLUGIN, pass, fail) .with_jest_plugin(true) .with_vitest_plugin(true) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/no_done_callback.rs b/crates/oxc_linter/src/rules/jest/no_done_callback.rs index f16f81e51ca74..5917912458034 100644 --- a/crates/oxc_linter/src/rules/jest/no_done_callback.rs +++ b/crates/oxc_linter/src/rules/jest/no_done_callback.rs @@ -71,6 +71,7 @@ declare_oxc_lint!( /// }); /// ``` NoDoneCallback, + jest, // TODO: add suggestion (see jest-community/eslint-plugin-jest#586) style ); @@ -287,7 +288,7 @@ fn test() { ("it.each``('something', ({ a, b }, done) => { done(); })", None), ]; - Tester::new(NoDoneCallback::NAME, NoDoneCallback::CATEGORY, pass, fail) + Tester::new(NoDoneCallback::NAME, NoDoneCallback::PLUGIN, pass, fail) .with_jest_plugin(true) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jest/no_duplicate_hooks.rs b/crates/oxc_linter/src/rules/jest/no_duplicate_hooks.rs index 2e3b28f6dd0a8..6e083842b407e 100644 --- a/crates/oxc_linter/src/rules/jest/no_duplicate_hooks.rs +++ b/crates/oxc_linter/src/rules/jest/no_duplicate_hooks.rs @@ -98,6 +98,7 @@ declare_oxc_lint!( /// }); /// ``` NoDuplicateHooks, + jest, style, ); @@ -554,7 +555,7 @@ fn test() { ), ]; - Tester::new(NoDuplicateHooks::NAME, NoDuplicateHooks::CATEGORY, pass, fail) + Tester::new(NoDuplicateHooks::NAME, NoDuplicateHooks::PLUGIN, pass, fail) .with_jest_plugin(true) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jest/no_export.rs b/crates/oxc_linter/src/rules/jest/no_export.rs index de9aff873bd34..a5d76066b8bfe 100644 --- a/crates/oxc_linter/src/rules/jest/no_export.rs +++ b/crates/oxc_linter/src/rules/jest/no_export.rs @@ -32,6 +32,7 @@ declare_oxc_lint!( /// }); /// ``` NoExport, + jest, correctness ); @@ -139,7 +140,7 @@ fn test() { // ("module.export.invalid = function() {}; ; test('a test', () => { expect(1).toBe(1);});", None) ]; - Tester::new(NoExport::NAME, NoExport::CATEGORY, pass, fail) + Tester::new(NoExport::NAME, NoExport::PLUGIN, pass, fail) .with_jest_plugin(true) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jest/no_focused_tests.rs b/crates/oxc_linter/src/rules/jest/no_focused_tests.rs index 8b008df6aac18..4efec57ad516b 100644 --- a/crates/oxc_linter/src/rules/jest/no_focused_tests.rs +++ b/crates/oxc_linter/src/rules/jest/no_focused_tests.rs @@ -61,6 +61,7 @@ declare_oxc_lint!( /// } /// ``` NoFocusedTests, + jest, correctness, fix ); @@ -196,7 +197,7 @@ fn test() { fail.extend(fail_vitest); fix.extend(fix_vitest); - Tester::new(NoFocusedTests::NAME, NoFocusedTests::CATEGORY, pass, fail) + Tester::new(NoFocusedTests::NAME, NoFocusedTests::PLUGIN, pass, fail) .with_jest_plugin(true) .expect_fix(fix) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/no_hooks.rs b/crates/oxc_linter/src/rules/jest/no_hooks.rs index 10273a0649fa9..28aa6e23e56c3 100644 --- a/crates/oxc_linter/src/rules/jest/no_hooks.rs +++ b/crates/oxc_linter/src/rules/jest/no_hooks.rs @@ -78,6 +78,7 @@ declare_oxc_lint!( /// }); /// ``` NoHooks, + jest, style, ); @@ -161,7 +162,7 @@ fn test() { ), ]; - Tester::new(NoHooks::NAME, NoHooks::CATEGORY, pass, fail) + Tester::new(NoHooks::NAME, NoHooks::PLUGIN, pass, fail) .with_jest_plugin(true) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jest/no_identical_title.rs b/crates/oxc_linter/src/rules/jest/no_identical_title.rs index 0f25ddf253cad..dc20201f54e18 100644 --- a/crates/oxc_linter/src/rules/jest/no_identical_title.rs +++ b/crates/oxc_linter/src/rules/jest/no_identical_title.rs @@ -67,6 +67,7 @@ declare_oxc_lint!( /// } /// ``` NoIdenticalTitle, + jest, style ); @@ -528,7 +529,7 @@ fn test() { pass.extend(pass_vitest.into_iter().map(|x| (x, None))); fail.extend(fail_vitest.into_iter().map(|x| (x, None))); - Tester::new(NoIdenticalTitle::NAME, NoIdenticalTitle::CATEGORY, pass, fail) + Tester::new(NoIdenticalTitle::NAME, NoIdenticalTitle::PLUGIN, pass, fail) .with_jest_plugin(true) .with_vitest_plugin(true) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/no_interpolation_in_snapshots.rs b/crates/oxc_linter/src/rules/jest/no_interpolation_in_snapshots.rs index 6fad6320887b1..5320efe267738 100644 --- a/crates/oxc_linter/src/rules/jest/no_interpolation_in_snapshots.rs +++ b/crates/oxc_linter/src/rules/jest/no_interpolation_in_snapshots.rs @@ -51,6 +51,7 @@ declare_oxc_lint!( /// ); /// ``` NoInterpolationInSnapshots, + jest, style ); @@ -122,7 +123,7 @@ fn test() { ("expect(something).not.toThrowErrorMatchingInlineSnapshot(`${interpolated}`);", None), ]; - Tester::new(NoInterpolationInSnapshots::NAME, NoInterpolationInSnapshots::CATEGORY, pass, fail) + Tester::new(NoInterpolationInSnapshots::NAME, NoInterpolationInSnapshots::PLUGIN, pass, fail) .with_jest_plugin(true) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jest/no_jasmine_globals.rs b/crates/oxc_linter/src/rules/jest/no_jasmine_globals.rs index 8eda042bd714c..6b4222341e920 100644 --- a/crates/oxc_linter/src/rules/jest/no_jasmine_globals.rs +++ b/crates/oxc_linter/src/rules/jest/no_jasmine_globals.rs @@ -34,6 +34,7 @@ declare_oxc_lint!( /// }); /// ``` NoJasmineGlobals, + jest, style, conditional_fix ); @@ -293,7 +294,7 @@ fn test() { ), ]; - Tester::new(NoJasmineGlobals::NAME, NoJasmineGlobals::CATEGORY, pass, fail) + Tester::new(NoJasmineGlobals::NAME, NoJasmineGlobals::PLUGIN, pass, fail) .with_jest_plugin(true) .expect_fix(fix) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/no_large_snapshots.rs b/crates/oxc_linter/src/rules/jest/no_large_snapshots.rs index 84b5625f0b9b5..76df0c34ce47b 100644 --- a/crates/oxc_linter/src/rules/jest/no_large_snapshots.rs +++ b/crates/oxc_linter/src/rules/jest/no_large_snapshots.rs @@ -132,6 +132,7 @@ declare_oxc_lint!( /// ``` /// NoLargeSnapshots, + jest, style, ); @@ -485,7 +486,7 @@ fn test() { // ), ]; - Tester::new(NoLargeSnapshots::NAME, NoLargeSnapshots::CATEGORY, pass, fail) + Tester::new(NoLargeSnapshots::NAME, NoLargeSnapshots::PLUGIN, pass, fail) .with_jest_plugin(true) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jest/no_mocks_import.rs b/crates/oxc_linter/src/rules/jest/no_mocks_import.rs index 11acf12811fbf..00934de5ffd79 100644 --- a/crates/oxc_linter/src/rules/jest/no_mocks_import.rs +++ b/crates/oxc_linter/src/rules/jest/no_mocks_import.rs @@ -40,6 +40,7 @@ declare_oxc_lint!( /// require('thing'); /// ``` NoMocksImport, + jest, style ); @@ -113,7 +114,7 @@ fn test() { ("import thing from './__mocks__/index'", None), ]; - Tester::new(NoMocksImport::NAME, NoMocksImport::CATEGORY, pass, fail) + Tester::new(NoMocksImport::NAME, NoMocksImport::PLUGIN, pass, fail) .with_jest_plugin(true) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jest/no_restricted_jest_methods.rs b/crates/oxc_linter/src/rules/jest/no_restricted_jest_methods.rs index 8b5425efd141b..7a6a06bb07d40 100644 --- a/crates/oxc_linter/src/rules/jest/no_restricted_jest_methods.rs +++ b/crates/oxc_linter/src/rules/jest/no_restricted_jest_methods.rs @@ -57,6 +57,7 @@ declare_oxc_lint!( /// }); /// ``` NoRestrictedJestMethods, + jest, style, ); @@ -215,7 +216,7 @@ fn test() { pass.extend(pass_vitest); fail.extend(fail_vitest); - Tester::new(NoRestrictedJestMethods::NAME, NoRestrictedJestMethods::CATEGORY, pass, fail) + Tester::new(NoRestrictedJestMethods::NAME, NoRestrictedJestMethods::PLUGIN, pass, fail) .with_jest_plugin(true) .with_vitest_plugin(true) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/no_restricted_matchers.rs b/crates/oxc_linter/src/rules/jest/no_restricted_matchers.rs index 2dba4269d3298..545d4f89af7c7 100644 --- a/crates/oxc_linter/src/rules/jest/no_restricted_matchers.rs +++ b/crates/oxc_linter/src/rules/jest/no_restricted_matchers.rs @@ -72,6 +72,7 @@ declare_oxc_lint!( /// ``` /// NoRestrictedMatchers, + jest, style, ); @@ -243,7 +244,7 @@ fn test() { ), ]; - Tester::new(NoRestrictedMatchers::NAME, NoRestrictedMatchers::CATEGORY, pass, fail) + Tester::new(NoRestrictedMatchers::NAME, NoRestrictedMatchers::PLUGIN, pass, fail) .with_jest_plugin(true) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jest/no_standalone_expect.rs b/crates/oxc_linter/src/rules/jest/no_standalone_expect.rs index 0e7ebed945263..a66e00a324538 100644 --- a/crates/oxc_linter/src/rules/jest/no_standalone_expect.rs +++ b/crates/oxc_linter/src/rules/jest/no_standalone_expect.rs @@ -56,6 +56,7 @@ declare_oxc_lint!( /// }); /// ``` NoStandaloneExpect, + jest, correctness ); @@ -386,7 +387,7 @@ fn test() { ), ]; - Tester::new(NoStandaloneExpect::NAME, NoStandaloneExpect::CATEGORY, pass, fail) + Tester::new(NoStandaloneExpect::NAME, NoStandaloneExpect::PLUGIN, pass, fail) .with_jest_plugin(true) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jest/no_test_prefixes.rs b/crates/oxc_linter/src/rules/jest/no_test_prefixes.rs index b53b88fa13bb0..b47e5f8438db0 100644 --- a/crates/oxc_linter/src/rules/jest/no_test_prefixes.rs +++ b/crates/oxc_linter/src/rules/jest/no_test_prefixes.rs @@ -53,6 +53,7 @@ declare_oxc_lint!( /// } /// ``` NoTestPrefixes, + jest, style, fix ); @@ -216,7 +217,7 @@ fn test() { ("fit('foo', () => {})", "it.only('foo', () => {})"), ]; - Tester::new(NoTestPrefixes::NAME, NoTestPrefixes::CATEGORY, pass, fail) + Tester::new(NoTestPrefixes::NAME, NoTestPrefixes::PLUGIN, pass, fail) .with_jest_plugin(true) .with_vitest_plugin(true) .expect_fix(fix) diff --git a/crates/oxc_linter/src/rules/jest/no_test_return_statement.rs b/crates/oxc_linter/src/rules/jest/no_test_return_statement.rs index aceda9a5de97e..3a91b4dcfd225 100644 --- a/crates/oxc_linter/src/rules/jest/no_test_return_statement.rs +++ b/crates/oxc_linter/src/rules/jest/no_test_return_statement.rs @@ -39,6 +39,7 @@ declare_oxc_lint!( /// }); /// ``` NoTestReturnStatement, + jest, style, ); @@ -235,7 +236,7 @@ fn test() { ), ]; - Tester::new(NoTestReturnStatement::NAME, NoTestReturnStatement::CATEGORY, pass, fail) + Tester::new(NoTestReturnStatement::NAME, NoTestReturnStatement::PLUGIN, pass, fail) .with_jest_plugin(true) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jest/no_untyped_mock_factory.rs b/crates/oxc_linter/src/rules/jest/no_untyped_mock_factory.rs index fa38956650416..52ee202354b26 100644 --- a/crates/oxc_linter/src/rules/jest/no_untyped_mock_factory.rs +++ b/crates/oxc_linter/src/rules/jest/no_untyped_mock_factory.rs @@ -83,6 +83,7 @@ declare_oxc_lint!( /// ``` /// NoUntypedMockFactory, + jest, style, conditional_fix ); @@ -401,7 +402,7 @@ fn test() { ), ]; - Tester::new(NoUntypedMockFactory::NAME, NoUntypedMockFactory::CATEGORY, pass, fail) + Tester::new(NoUntypedMockFactory::NAME, NoUntypedMockFactory::PLUGIN, pass, fail) .with_jest_plugin(true) .expect_fix(fix) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/prefer_called_with.rs b/crates/oxc_linter/src/rules/jest/prefer_called_with.rs index ee969ba974f21..13fb89ec37496 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_called_with.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_called_with.rs @@ -44,6 +44,7 @@ declare_oxc_lint!( /// ``` /// PreferCalledWith, + jest, style, ); @@ -114,7 +115,7 @@ fn test() { ("expect(fn).toHaveBeenCalled();", None), ]; - Tester::new(PreferCalledWith::NAME, PreferCalledWith::CATEGORY, pass, fail) + Tester::new(PreferCalledWith::NAME, PreferCalledWith::PLUGIN, pass, fail) .with_jest_plugin(true) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jest/prefer_comparison_matcher.rs b/crates/oxc_linter/src/rules/jest/prefer_comparison_matcher.rs index b067631b98913..ef89db166c18b 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_comparison_matcher.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_comparison_matcher.rs @@ -55,6 +55,7 @@ declare_oxc_lint!( /// ``` /// PreferComparisonMatcher, + jest, style, fix ); @@ -468,7 +469,7 @@ fn test() { fix.push((case.as_str(), fixer.as_str(), None)); } - Tester::new(PreferComparisonMatcher::NAME, PreferComparisonMatcher::CATEGORY, pass, fail) + Tester::new(PreferComparisonMatcher::NAME, PreferComparisonMatcher::PLUGIN, pass, fail) .with_jest_plugin(true) .expect_fix(fix) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/prefer_equality_matcher.rs b/crates/oxc_linter/src/rules/jest/prefer_equality_matcher.rs index bf4efde67d5e9..3fee8decaa7fa 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_equality_matcher.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_equality_matcher.rs @@ -41,6 +41,7 @@ declare_oxc_lint!( /// expect(myObj).toStrictEqual(thatObj); /// ``` PreferEqualityMatcher, + jest, style, ); @@ -119,7 +120,7 @@ fn test() { ("expect(a !== b).resolves.not.toBe(false)", None), ]; - Tester::new(PreferEqualityMatcher::NAME, PreferEqualityMatcher::CATEGORY, pass, fail) + Tester::new(PreferEqualityMatcher::NAME, PreferEqualityMatcher::PLUGIN, pass, fail) .with_jest_plugin(true) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jest/prefer_expect_resolves.rs b/crates/oxc_linter/src/rules/jest/prefer_expect_resolves.rs index ba612ed29e41a..1236e1eb529f6 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_expect_resolves.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_expect_resolves.rs @@ -68,6 +68,7 @@ declare_oxc_lint!( /// }); /// ``` PreferExpectResolves, + jest, style, fix ); @@ -261,7 +262,7 @@ fn tests() { ), ]; - Tester::new(PreferExpectResolves::NAME, PreferExpectResolves::CATEGORY, pass, fail) + Tester::new(PreferExpectResolves::NAME, PreferExpectResolves::PLUGIN, pass, fail) .with_jest_plugin(true) .expect_fix(fix) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/prefer_hooks_in_order.rs b/crates/oxc_linter/src/rules/jest/prefer_hooks_in_order.rs index e8809b6496f95..75e40a5f7a31d 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_hooks_in_order.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_hooks_in_order.rs @@ -138,6 +138,7 @@ declare_oxc_lint!( /// } /// } PreferHooksInOrder, + jest, style, ); @@ -1264,7 +1265,7 @@ fn test() { pass.extend(pass_vitest.into_iter().map(|x| (x, None))); fail.extend(fail_vitest.into_iter().map(|x| (x, None))); - Tester::new(PreferHooksInOrder::NAME, PreferHooksInOrder::CATEGORY, pass, fail) + Tester::new(PreferHooksInOrder::NAME, PreferHooksInOrder::PLUGIN, pass, fail) .with_jest_plugin(true) .with_vitest_plugin(true) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/prefer_hooks_on_top.rs b/crates/oxc_linter/src/rules/jest/prefer_hooks_on_top.rs index b0b4b86c1a676..4522ad64cce82 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_hooks_on_top.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_hooks_on_top.rs @@ -135,6 +135,7 @@ declare_oxc_lint!( /// }); /// ``` PreferHooksOnTop, + jest, style, ); @@ -375,7 +376,7 @@ fn test() { ), ]; - Tester::new(PreferHooksOnTop::NAME, PreferHooksOnTop::CATEGORY, pass, fail) + Tester::new(PreferHooksOnTop::NAME, PreferHooksOnTop::PLUGIN, pass, fail) .with_jest_plugin(true) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jest/prefer_jest_mocked.rs b/crates/oxc_linter/src/rules/jest/prefer_jest_mocked.rs index 065e073b19f7c..c0452fe845b29 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_jest_mocked.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_jest_mocked.rs @@ -50,6 +50,7 @@ declare_oxc_lint!( /// jest.mocked([].foo).mockReturnValue(1); /// ``` PreferJestMocked, + jest, style, conditional_fix ); @@ -349,7 +350,7 @@ fn test() { ("(foo as jest.Mock) = jest.fn();", "(foo as jest.Mock) = jest.fn();"), ]; - Tester::new(PreferJestMocked::NAME, PreferJestMocked::CATEGORY, pass, fail) + Tester::new(PreferJestMocked::NAME, PreferJestMocked::PLUGIN, pass, fail) .with_jest_plugin(true) .expect_fix(fix) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/prefer_lowercase_title.rs b/crates/oxc_linter/src/rules/jest/prefer_lowercase_title.rs index 1acb980de3183..270eb644ae76a 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_lowercase_title.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_lowercase_title.rs @@ -127,6 +127,7 @@ declare_oxc_lint!( /// ``` /// PreferLowercaseTitle, + jest, style, fix ); @@ -626,7 +627,7 @@ fn test() { ), ]; - Tester::new(PreferLowercaseTitle::NAME, PreferLowercaseTitle::CATEGORY, pass, fail) + Tester::new(PreferLowercaseTitle::NAME, PreferLowercaseTitle::PLUGIN, pass, fail) .with_jest_plugin(true) .expect_fix(fix) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/prefer_mock_promise_shorthand.rs b/crates/oxc_linter/src/rules/jest/prefer_mock_promise_shorthand.rs index 0e07c7d312b63..48fadca7008ac 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_mock_promise_shorthand.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_mock_promise_shorthand.rs @@ -51,6 +51,7 @@ declare_oxc_lint!( /// ``` /// PreferMockPromiseShorthand, + jest, style, conditional_fix ); @@ -430,7 +431,7 @@ fn test() { // ), ]; - Tester::new(PreferMockPromiseShorthand::NAME, PreferMockPromiseShorthand::CATEGORY, pass, fail) + Tester::new(PreferMockPromiseShorthand::NAME, PreferMockPromiseShorthand::PLUGIN, pass, fail) .with_jest_plugin(true) .expect_fix(fix) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/prefer_spy_on.rs b/crates/oxc_linter/src/rules/jest/prefer_spy_on.rs index 9ff18253adbc6..20c17e5648916 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_spy_on.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_spy_on.rs @@ -52,6 +52,7 @@ declare_oxc_lint!( /// jest.spyOn(Date, 'now').mockImplementation(() => 10); /// ``` PreferSpyOn, + jest, style, fix ); @@ -299,7 +300,7 @@ fn tests() { ), ]; - Tester::new(PreferSpyOn::NAME, PreferSpyOn::CATEGORY, pass, fail) + Tester::new(PreferSpyOn::NAME, PreferSpyOn::PLUGIN, pass, fail) .with_jest_plugin(true) .expect_fix(fix) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/prefer_strict_equal.rs b/crates/oxc_linter/src/rules/jest/prefer_strict_equal.rs index 775ed3519d557..8f8b70a43384d 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_strict_equal.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_strict_equal.rs @@ -33,6 +33,7 @@ declare_oxc_lint!( /// ``` /// PreferStrictEqual, + jest, style, fix ); @@ -104,7 +105,7 @@ fn test() { ), ]; - Tester::new(PreferStrictEqual::NAME, PreferStrictEqual::CATEGORY, pass, fail) + Tester::new(PreferStrictEqual::NAME, PreferStrictEqual::PLUGIN, pass, fail) .with_jest_plugin(true) .expect_fix(fix) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/prefer_to_be.rs b/crates/oxc_linter/src/rules/jest/prefer_to_be.rs index 4f7be7973214c..d75f9951365f6 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_to_be.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_to_be.rs @@ -65,6 +65,7 @@ declare_oxc_lint!( /// expect(loadMessage()).resolves.toEqual('hello world'); /// ``` PreferToBe, + jest, style, fix ); @@ -552,7 +553,7 @@ fn tests() { ), ]; - Tester::new(PreferToBe::NAME, PreferToBe::CATEGORY, pass, fail) + Tester::new(PreferToBe::NAME, PreferToBe::PLUGIN, pass, fail) .with_jest_plugin(true) .expect_fix(fix) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/prefer_to_contain.rs b/crates/oxc_linter/src/rules/jest/prefer_to_contain.rs index 37a6d0e4a02dd..e8994992cbbde 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_to_contain.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_to_contain.rs @@ -49,6 +49,7 @@ declare_oxc_lint!( /// ``` /// PreferToContain, + jest, style, ); @@ -219,7 +220,7 @@ fn tests() { ("expect(a.includes(b)).toEqual(false as boolean);", None), ]; - Tester::new(PreferToContain::NAME, PreferToContain::CATEGORY, pass, fail) + Tester::new(PreferToContain::NAME, PreferToContain::PLUGIN, pass, fail) .with_jest_plugin(true) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jest/prefer_to_have_length.rs b/crates/oxc_linter/src/rules/jest/prefer_to_have_length.rs index d7b3764c4f1da..bad5020dd7e5d 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_to_have_length.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_to_have_length.rs @@ -47,6 +47,7 @@ declare_oxc_lint!( /// ``` /// PreferToHaveLength, + jest, style, fix ); @@ -265,7 +266,7 @@ fn tests() { ), ]; - Tester::new(PreferToHaveLength::NAME, PreferToHaveLength::CATEGORY, pass, fail) + Tester::new(PreferToHaveLength::NAME, PreferToHaveLength::PLUGIN, pass, fail) .with_jest_plugin(true) .expect_fix(fix) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/prefer_todo.rs b/crates/oxc_linter/src/rules/jest/prefer_todo.rs index 3fb6f8abc1a8d..28eaa2ce0768d 100644 --- a/crates/oxc_linter/src/rules/jest/prefer_todo.rs +++ b/crates/oxc_linter/src/rules/jest/prefer_todo.rs @@ -43,6 +43,7 @@ declare_oxc_lint!( /// test.todo('i need to write this test'); /// ``` PreferTodo, + jest, style, fix ); @@ -248,7 +249,7 @@ fn tests() { ), ]; - Tester::new(PreferTodo::NAME, PreferTodo::CATEGORY, pass, fail) + Tester::new(PreferTodo::NAME, PreferTodo::PLUGIN, pass, fail) .with_jest_plugin(true) .expect_fix(fix) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/require_hook.rs b/crates/oxc_linter/src/rules/jest/require_hook.rs index b95fe33367328..e35d6792742bb 100644 --- a/crates/oxc_linter/src/rules/jest/require_hook.rs +++ b/crates/oxc_linter/src/rules/jest/require_hook.rs @@ -144,6 +144,7 @@ declare_oxc_lint!( /// ``` /// RequireHook, + jest, style ); @@ -620,7 +621,7 @@ fn tests() { ), ]; - Tester::new(RequireHook::NAME, RequireHook::CATEGORY, pass, fail) + Tester::new(RequireHook::NAME, RequireHook::PLUGIN, pass, fail) .with_jest_plugin(true) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jest/require_to_throw_message.rs b/crates/oxc_linter/src/rules/jest/require_to_throw_message.rs index 6a4554f56689c..50e20c6001134 100644 --- a/crates/oxc_linter/src/rules/jest/require_to_throw_message.rs +++ b/crates/oxc_linter/src/rules/jest/require_to_throw_message.rs @@ -42,6 +42,7 @@ declare_oxc_lint!( /// ``` /// RequireToThrowMessage, + jest, correctness ); @@ -179,7 +180,7 @@ fn test() { ), ]; - Tester::new(RequireToThrowMessage::NAME, RequireToThrowMessage::CATEGORY, pass, fail) + Tester::new(RequireToThrowMessage::NAME, RequireToThrowMessage::PLUGIN, pass, fail) .with_jest_plugin(true) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jest/require_top_level_describe.rs b/crates/oxc_linter/src/rules/jest/require_top_level_describe.rs index ce6f2a77facbc..7d7722209eedc 100644 --- a/crates/oxc_linter/src/rules/jest/require_top_level_describe.rs +++ b/crates/oxc_linter/src/rules/jest/require_top_level_describe.rs @@ -106,6 +106,7 @@ declare_oxc_lint!( /// ``` /// RequireTopLevelDescribe, + jest, style, ); @@ -392,7 +393,7 @@ fn test() { ), ]; - Tester::new(RequireTopLevelDescribe::NAME, RequireTopLevelDescribe::CATEGORY, pass, fail) + Tester::new(RequireTopLevelDescribe::NAME, RequireTopLevelDescribe::PLUGIN, pass, fail) .with_jest_plugin(true) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jest/valid_describe_callback.rs b/crates/oxc_linter/src/rules/jest/valid_describe_callback.rs index cf7fb53d2e51d..ec75c0c725ee5 100644 --- a/crates/oxc_linter/src/rules/jest/valid_describe_callback.rs +++ b/crates/oxc_linter/src/rules/jest/valid_describe_callback.rs @@ -69,6 +69,7 @@ declare_oxc_lint!( /// } /// ``` ValidDescribeCallback, + jest, correctness ); @@ -512,7 +513,7 @@ fn test() { pass.extend(pass_vitest); fail.extend(fail_vitest); - Tester::new(ValidDescribeCallback::NAME, ValidDescribeCallback::CATEGORY, pass, fail) + Tester::new(ValidDescribeCallback::NAME, ValidDescribeCallback::PLUGIN, pass, fail) .with_jest_plugin(true) .with_vitest_plugin(true) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/valid_expect.rs b/crates/oxc_linter/src/rules/jest/valid_expect.rs index 0976b661ce544..f80f46da6ac99 100644 --- a/crates/oxc_linter/src/rules/jest/valid_expect.rs +++ b/crates/oxc_linter/src/rules/jest/valid_expect.rs @@ -90,6 +90,7 @@ declare_oxc_lint!( /// } /// ``` ValidExpect, + jest, correctness ); @@ -434,7 +435,7 @@ fn test_1() { )]; let fail = vec![]; - Tester::new(ValidExpect::NAME, ValidExpect::CATEGORY, pass, fail).with_jest_plugin(true).test(); + Tester::new(ValidExpect::NAME, ValidExpect::PLUGIN, pass, fail).with_jest_plugin(true).test(); } #[test] @@ -1143,7 +1144,7 @@ fn test() { pass.extend(pass_vitest); fail.extend(fail_vitest); - Tester::new(ValidExpect::NAME, ValidExpect::CATEGORY, pass, fail) + Tester::new(ValidExpect::NAME, ValidExpect::PLUGIN, pass, fail) .with_jest_plugin(true) .with_vitest_plugin(true) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jest/valid_title.rs b/crates/oxc_linter/src/rules/jest/valid_title.rs index b86418078fdea..076839242bef6 100644 --- a/crates/oxc_linter/src/rules/jest/valid_title.rs +++ b/crates/oxc_linter/src/rules/jest/valid_title.rs @@ -76,6 +76,7 @@ declare_oxc_lint!( /// it('bar', () => {}); /// test('baz', () => {}); ValidTitle, + jest, correctness, conditional_fix ); @@ -1031,7 +1032,7 @@ fn test() { ), ]; - Tester::new(ValidTitle::NAME, ValidTitle::CATEGORY, pass, fail) + Tester::new(ValidTitle::NAME, ValidTitle::PLUGIN, pass, fail) .with_jest_plugin(true) .expect_fix(fix) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jsdoc/check_access.rs b/crates/oxc_linter/src/rules/jsdoc/check_access.rs index 658a5b326f35b..61cab02c6b42a 100644 --- a/crates/oxc_linter/src/rules/jsdoc/check_access.rs +++ b/crates/oxc_linter/src/rules/jsdoc/check_access.rs @@ -53,6 +53,7 @@ declare_oxc_lint!( /// /** @private */ /// ``` CheckAccess, + jsdoc, restriction ); @@ -368,5 +369,5 @@ fn test() { ), ]; - Tester::new(CheckAccess::NAME, CheckAccess::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(CheckAccess::NAME, CheckAccess::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsdoc/check_property_names.rs b/crates/oxc_linter/src/rules/jsdoc/check_property_names.rs index d37b07454da10..a1c1fefad54a3 100644 --- a/crates/oxc_linter/src/rules/jsdoc/check_property_names.rs +++ b/crates/oxc_linter/src/rules/jsdoc/check_property_names.rs @@ -57,6 +57,7 @@ declare_oxc_lint!( /// */ /// ``` CheckPropertyNames, + jsdoc, correctness ); @@ -426,6 +427,6 @@ fn test() { ), ]; - Tester::new(CheckPropertyNames::NAME, CheckPropertyNames::CATEGORY, pass, fail) + Tester::new(CheckPropertyNames::NAME, CheckPropertyNames::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsdoc/check_tag_names.rs b/crates/oxc_linter/src/rules/jsdoc/check_tag_names.rs index 7da6e55acff31..a483cfecdf238 100644 --- a/crates/oxc_linter/src/rules/jsdoc/check_tag_names.rs +++ b/crates/oxc_linter/src/rules/jsdoc/check_tag_names.rs @@ -45,6 +45,7 @@ declare_oxc_lint!( /// /** @param */ /// ``` CheckTagNames, + jsdoc, correctness ); @@ -1118,9 +1119,9 @@ fn test() { None, )]; - Tester::new(CheckTagNames::NAME, CheckTagNames::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(CheckTagNames::NAME, CheckTagNames::PLUGIN, pass, fail).test_and_snapshot(); // Currently only 1 snapshot can be saved under a rule name - Tester::new(CheckTagNames::NAME, CheckTagNames::CATEGORY, dts_pass, dts_fail) + Tester::new(CheckTagNames::NAME, CheckTagNames::PLUGIN, dts_pass, dts_fail) .change_rule_path("test.d.ts") .test(); } diff --git a/crates/oxc_linter/src/rules/jsdoc/empty_tags.rs b/crates/oxc_linter/src/rules/jsdoc/empty_tags.rs index 6aff69a804a58..de7728cf6e51c 100644 --- a/crates/oxc_linter/src/rules/jsdoc/empty_tags.rs +++ b/crates/oxc_linter/src/rules/jsdoc/empty_tags.rs @@ -58,6 +58,7 @@ declare_oxc_lint!( /// /** @private */ /// ``` EmptyTags, + jsdoc, restriction ); @@ -363,5 +364,5 @@ fn test() { ), ]; - Tester::new(EmptyTags::NAME, EmptyTags::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(EmptyTags::NAME, EmptyTags::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsdoc/implements_on_classes.rs b/crates/oxc_linter/src/rules/jsdoc/implements_on_classes.rs index 82fe13590317e..e3568ee569cef 100644 --- a/crates/oxc_linter/src/rules/jsdoc/implements_on_classes.rs +++ b/crates/oxc_linter/src/rules/jsdoc/implements_on_classes.rs @@ -55,6 +55,7 @@ declare_oxc_lint!( /// function quux () {} /// ``` ImplementsOnClasses, + jsdoc, correctness ); @@ -293,6 +294,6 @@ fn test() { ), ]; - Tester::new(ImplementsOnClasses::NAME, ImplementsOnClasses::CATEGORY, pass, fail) + Tester::new(ImplementsOnClasses::NAME, ImplementsOnClasses::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsdoc/no_defaults.rs b/crates/oxc_linter/src/rules/jsdoc/no_defaults.rs index 451925d022169..c3a1757a92045 100644 --- a/crates/oxc_linter/src/rules/jsdoc/no_defaults.rs +++ b/crates/oxc_linter/src/rules/jsdoc/no_defaults.rs @@ -46,6 +46,7 @@ declare_oxc_lint!( /// function quux (foo) {} /// ``` NoDefaults, + jsdoc, correctness ); @@ -405,5 +406,5 @@ fn test() { // ), ]; - Tester::new(NoDefaults::NAME, NoDefaults::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(NoDefaults::NAME, NoDefaults::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsdoc/require_param.rs b/crates/oxc_linter/src/rules/jsdoc/require_param.rs index be919f4b61101..381318eda0ae5 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_param.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_param.rs @@ -44,6 +44,7 @@ declare_oxc_lint!( /// function quux (foo) {} /// ``` RequireParam, + jsdoc, pedantic, ); @@ -1372,5 +1373,5 @@ fn test() { ), ]; - Tester::new(RequireParam::NAME, RequireParam::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(RequireParam::NAME, RequireParam::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsdoc/require_param_description.rs b/crates/oxc_linter/src/rules/jsdoc/require_param_description.rs index d3725ecc3f75b..1ffe665a78c34 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_param_description.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_param_description.rs @@ -45,6 +45,7 @@ declare_oxc_lint!( /// function quux (foo) {} /// ``` RequireParamDescription, + jsdoc, pedantic, ); @@ -277,6 +278,6 @@ fn test() { ), ]; - Tester::new(RequireParamDescription::NAME, RequireParamDescription::CATEGORY, pass, fail) + Tester::new(RequireParamDescription::NAME, RequireParamDescription::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsdoc/require_param_name.rs b/crates/oxc_linter/src/rules/jsdoc/require_param_name.rs index 9c9fcda195f0d..bc0968b8f605c 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_param_name.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_param_name.rs @@ -42,6 +42,7 @@ declare_oxc_lint!( /// function quux (foo) {} /// ``` RequireParamName, + jsdoc, pedantic, ); @@ -189,5 +190,5 @@ fn test() { ), ]; - Tester::new(RequireParamName::NAME, RequireParamName::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(RequireParamName::NAME, RequireParamName::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsdoc/require_param_type.rs b/crates/oxc_linter/src/rules/jsdoc/require_param_type.rs index f7e3fa15dd12d..a4735cbbec8f2 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_param_type.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_param_type.rs @@ -45,6 +45,7 @@ declare_oxc_lint!( /// function quux (foo) {} /// ``` RequireParamType, + jsdoc, pedantic, ); @@ -257,5 +258,5 @@ fn test() { ), ]; - Tester::new(RequireParamType::NAME, RequireParamType::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(RequireParamType::NAME, RequireParamType::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsdoc/require_property.rs b/crates/oxc_linter/src/rules/jsdoc/require_property.rs index 32eaf145906c9..4c986a66bc799 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_property.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_property.rs @@ -55,6 +55,7 @@ declare_oxc_lint!( /// */ /// ``` RequireProperty, + jsdoc, correctness ); @@ -283,5 +284,5 @@ fn test() { ), ]; - Tester::new(RequireProperty::NAME, RequireProperty::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(RequireProperty::NAME, RequireProperty::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsdoc/require_property_description.rs b/crates/oxc_linter/src/rules/jsdoc/require_property_description.rs index 1470905217369..fb19ef2d446d8 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_property_description.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_property_description.rs @@ -44,6 +44,7 @@ declare_oxc_lint!( /// */ /// ``` RequirePropertyDescription, + jsdoc, correctness ); @@ -201,6 +202,6 @@ fn test() { ), ]; - Tester::new(RequirePropertyDescription::NAME, RequirePropertyDescription::CATEGORY, pass, fail) + Tester::new(RequirePropertyDescription::NAME, RequirePropertyDescription::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsdoc/require_property_name.rs b/crates/oxc_linter/src/rules/jsdoc/require_property_name.rs index 03727dbe53b70..3c87909a0e539 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_property_name.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_property_name.rs @@ -44,6 +44,7 @@ declare_oxc_lint!( /// */ /// ``` RequirePropertyName, + jsdoc, correctness ); @@ -162,6 +163,6 @@ fn test() { ), ]; - Tester::new(RequirePropertyName::NAME, RequirePropertyName::CATEGORY, pass, fail) + Tester::new(RequirePropertyName::NAME, RequirePropertyName::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsdoc/require_property_type.rs b/crates/oxc_linter/src/rules/jsdoc/require_property_type.rs index dfa5ed04a77ee..20598e51e8cb2 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_property_type.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_property_type.rs @@ -44,6 +44,7 @@ declare_oxc_lint!( /// */ /// ``` RequirePropertyType, + jsdoc, correctness ); @@ -187,6 +188,6 @@ fn test() { ), ]; - Tester::new(RequirePropertyType::NAME, RequirePropertyType::CATEGORY, pass, fail) + Tester::new(RequirePropertyType::NAME, RequirePropertyType::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsdoc/require_returns.rs b/crates/oxc_linter/src/rules/jsdoc/require_returns.rs index 366071c323cf4..249e2118b9387 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_returns.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_returns.rs @@ -63,6 +63,7 @@ declare_oxc_lint!( /// function quux () { return foo; } /// ``` RequireReturns, + jsdoc, pedantic, ); @@ -2235,5 +2236,5 @@ fn test() { ), ]; - Tester::new(RequireReturns::NAME, RequireReturns::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(RequireReturns::NAME, RequireReturns::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsdoc/require_returns_description.rs b/crates/oxc_linter/src/rules/jsdoc/require_returns_description.rs index d19933aaf9150..32f86f27f211e 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_returns_description.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_returns_description.rs @@ -43,6 +43,7 @@ declare_oxc_lint!( /// function quux (foo) {} /// ``` RequireReturnsDescription, + jsdoc, pedantic, ); @@ -256,6 +257,6 @@ fn test() { ), ]; - Tester::new(RequireReturnsDescription::NAME, RequireReturnsDescription::CATEGORY, pass, fail) + Tester::new(RequireReturnsDescription::NAME, RequireReturnsDescription::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsdoc/require_returns_type.rs b/crates/oxc_linter/src/rules/jsdoc/require_returns_type.rs index d4933e29b25ea..6f44c6affb454 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_returns_type.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_returns_type.rs @@ -42,6 +42,7 @@ declare_oxc_lint!( /// function quux (foo) {} /// ``` RequireReturnsType, + jsdoc, pedantic, ); @@ -161,6 +162,6 @@ fn test() { ), ]; - Tester::new(RequireReturnsType::NAME, RequireReturnsType::CATEGORY, pass, fail) + Tester::new(RequireReturnsType::NAME, RequireReturnsType::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsdoc/require_yields.rs b/crates/oxc_linter/src/rules/jsdoc/require_yields.rs index 95707e09bc0aa..3dac3516452bc 100644 --- a/crates/oxc_linter/src/rules/jsdoc/require_yields.rs +++ b/crates/oxc_linter/src/rules/jsdoc/require_yields.rs @@ -66,6 +66,7 @@ declare_oxc_lint!( /// function * quux (foo) { yield foo; } /// ``` RequireYields, + jsdoc, correctness ); @@ -1458,5 +1459,5 @@ fn test() { ), ]; - Tester::new(RequireYields::NAME, RequireYields::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(RequireYields::NAME, RequireYields::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/alt_text.rs b/crates/oxc_linter/src/rules/jsx_a11y/alt_text.rs index 5bea6556e2ff4..6313919386119 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/alt_text.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/alt_text.rs @@ -130,6 +130,7 @@ declare_oxc_lint!( /// /// ``` AltText, + jsx_a11y, correctness ); @@ -527,7 +528,7 @@ fn test() { (r#""#, None, None), ]; - Tester::new(AltText::NAME, AltText::CATEGORY, pass, fail) + Tester::new(AltText::NAME, AltText::PLUGIN, pass, fail) .with_jsx_a11y_plugin(true) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/anchor_ambiguous_text.rs b/crates/oxc_linter/src/rules/jsx_a11y/anchor_ambiguous_text.rs index 1a04fdfdcf8b1..cd52f1a1fef4b 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/anchor_ambiguous_text.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/anchor_ambiguous_text.rs @@ -82,6 +82,7 @@ declare_oxc_lint!( /// click here /// ``` AnchorAmbiguousText, + jsx_a11y, restriction, ); @@ -307,6 +308,6 @@ fn test() { ), ]; - Tester::new(AnchorAmbiguousText::NAME, AnchorAmbiguousText::CATEGORY, pass, fail) + Tester::new(AnchorAmbiguousText::NAME, AnchorAmbiguousText::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/anchor_has_content.rs b/crates/oxc_linter/src/rules/jsx_a11y/anchor_has_content.rs index 18dfa6c782367..70c25bd262f20 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/anchor_has_content.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/anchor_has_content.rs @@ -57,6 +57,7 @@ declare_oxc_lint!( /// ``` /// AnchorHasContent, + jsx_a11y, correctness, conditional_suggestion ); @@ -183,7 +184,7 @@ fn test() { ), ]; - Tester::new(AnchorHasContent::NAME, AnchorHasContent::CATEGORY, pass, fail) + Tester::new(AnchorHasContent::NAME, AnchorHasContent::PLUGIN, pass, fail) .expect_fix(fix) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/anchor_is_valid.rs b/crates/oxc_linter/src/rules/jsx_a11y/anchor_is_valid.rs index f53e598040bf0..accbfac2fa2e6 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/anchor_is_valid.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/anchor_is_valid.rs @@ -116,6 +116,7 @@ declare_oxc_lint!( /// /// - [WCAG 2.1.1](https://www.w3.org/WAI/WCAG21/Understanding/keyboard) AnchorIsValid, + jsx_a11y, correctness ); @@ -768,5 +769,5 @@ fn test() { // ), ]; - Tester::new(AnchorIsValid::NAME, AnchorIsValid::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(AnchorIsValid::NAME, AnchorIsValid::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/aria_activedescendant_has_tabindex.rs b/crates/oxc_linter/src/rules/jsx_a11y/aria_activedescendant_has_tabindex.rs index 84c276c9e8ef6..e310e57158596 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/aria_activedescendant_has_tabindex.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/aria_activedescendant_has_tabindex.rs @@ -51,6 +51,7 @@ declare_oxc_lint!( /// const Bad =
/// ``` AriaActivedescendantHasTabindex, + jsx_a11y, correctness ); @@ -143,7 +144,7 @@ fn test() { Tester::new( AriaActivedescendantHasTabindex::NAME, - AriaActivedescendantHasTabindex::CATEGORY, + AriaActivedescendantHasTabindex::PLUGIN, pass, fail, ) diff --git a/crates/oxc_linter/src/rules/jsx_a11y/aria_props.rs b/crates/oxc_linter/src/rules/jsx_a11y/aria_props.rs index 8ff192d95a16d..17921d0a08280 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/aria_props.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/aria_props.rs @@ -46,6 +46,7 @@ declare_oxc_lint!( /// /// ``` AriaProps, + jsx_a11y, correctness, conditional_fix ); @@ -102,7 +103,5 @@ fn test() { let fix = vec![(r#"
"#, r#"
"#, None)]; - Tester::new(AriaProps::NAME, AriaProps::CATEGORY, pass, fail) - .expect_fix(fix) - .test_and_snapshot(); + Tester::new(AriaProps::NAME, AriaProps::PLUGIN, pass, fail).expect_fix(fix).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/aria_role.rs b/crates/oxc_linter/src/rules/jsx_a11y/aria_role.rs index 91376a4398903..236b65b5e7327 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/aria_role.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/aria_role.rs @@ -110,6 +110,7 @@ declare_oxc_lint!( /// /// ``` AriaRole, + jsx_a11y, correctness ); @@ -255,5 +256,5 @@ fn test() { ("", None, None, None), ]; - Tester::new(AriaRole::NAME, AriaRole::CATEGORY, pass, fail).test_and_snapshot(); + Tester::new(AriaRole::NAME, AriaRole::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/aria_unsupported_elements.rs b/crates/oxc_linter/src/rules/jsx_a11y/aria_unsupported_elements.rs index 4a4b933247998..3c2e2f50adde8 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/aria_unsupported_elements.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/aria_unsupported_elements.rs @@ -33,6 +33,7 @@ declare_oxc_lint! { /// ``` /// AriaUnsupportedElements, + jsx_a11y, correctness, fix } @@ -430,7 +431,7 @@ fn test() { ), ]; - Tester::new(AriaUnsupportedElements::NAME, AriaUnsupportedElements::CATEGORY, pass, fail) + Tester::new(AriaUnsupportedElements::NAME, AriaUnsupportedElements::PLUGIN, pass, fail) .with_jsx_a11y_plugin(true) .expect_fix(fix) .test_and_snapshot(); diff --git a/crates/oxc_linter/src/rules/jsx_a11y/autocomplete_valid.rs b/crates/oxc_linter/src/rules/jsx_a11y/autocomplete_valid.rs index e230ef0fc95a4..d97f9ff7cdea9 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/autocomplete_valid.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/autocomplete_valid.rs @@ -43,6 +43,7 @@ declare_oxc_lint!( /// /// ``` AutocompleteValid, + jsx_a11y, correctness ); @@ -259,6 +260,5 @@ fn test() { (";", None, Some(settings())), ]; - Tester::new(AutocompleteValid::NAME, AutocompleteValid::CATEGORY, pass, fail) - .test_and_snapshot(); + Tester::new(AutocompleteValid::NAME, AutocompleteValid::PLUGIN, pass, fail).test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/click_events_have_key_events.rs b/crates/oxc_linter/src/rules/jsx_a11y/click_events_have_key_events.rs index fe26185a59743..4f6257c3e9bca 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/click_events_have_key_events.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/click_events_have_key_events.rs @@ -45,6 +45,7 @@ declare_oxc_lint!( ///
void 0} onKeyDown={() => void 0} /> /// ``` ClickEventsHaveKeyEvents, + jsx_a11y, correctness ); @@ -147,6 +148,6 @@ fn test() { ), ]; - Tester::new(ClickEventsHaveKeyEvents::NAME, ClickEventsHaveKeyEvents::CATEGORY, pass, fail) + Tester::new(ClickEventsHaveKeyEvents::NAME, ClickEventsHaveKeyEvents::PLUGIN, pass, fail) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/heading_has_content.rs b/crates/oxc_linter/src/rules/jsx_a11y/heading_has_content.rs index cc6954e614f7f..b381374ae0494 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/heading_has_content.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/heading_has_content.rs @@ -60,6 +60,7 @@ declare_oxc_lint!( ///

Foo

/// ``` HeadingHasContent, + jsx_a11y, correctness ); @@ -181,7 +182,7 @@ fn test() { // (r#"

"#, None, Some(settings())), ]; - Tester::new(HeadingHasContent::NAME, HeadingHasContent::CATEGORY, pass, fail) + Tester::new(HeadingHasContent::NAME, HeadingHasContent::PLUGIN, pass, fail) .with_jsx_a11y_plugin(true) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/html_has_lang.rs b/crates/oxc_linter/src/rules/jsx_a11y/html_has_lang.rs index 53b22b91058b9..4d1189331e0d5 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/html_has_lang.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/html_has_lang.rs @@ -52,6 +52,7 @@ declare_oxc_lint!( /// /// ``` HtmlHasLang, + jsx_a11y, correctness ); @@ -138,7 +139,7 @@ fn test() { ("", None, Some(settings()), None), ]; - Tester::new(HtmlHasLang::NAME, HtmlHasLang::CATEGORY, pass, fail) + Tester::new(HtmlHasLang::NAME, HtmlHasLang::PLUGIN, pass, fail) .with_jsx_a11y_plugin(true) .test_and_snapshot(); } diff --git a/crates/oxc_linter/src/rules/jsx_a11y/iframe_has_title.rs b/crates/oxc_linter/src/rules/jsx_a11y/iframe_has_title.rs index 99695e766ac38..b23b5d5b4cac1 100644 --- a/crates/oxc_linter/src/rules/jsx_a11y/iframe_has_title.rs +++ b/crates/oxc_linter/src/rules/jsx_a11y/iframe_has_title.rs @@ -57,6 +57,7 @@ declare_oxc_lint!( ///