From 7db67538a10395cc234e5991f17f19ba7d6046f1 Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Wed, 21 Jan 2026 12:18:37 +0000 Subject: [PATCH] test(linter/plugins): simplify tester script (#18343) Simplify tester script. `config` is not needed any more. The conformance tests' version of `RuleTester` already enables `eslintCompat` option. --- apps/oxlint/conformance/tester.ts | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/apps/oxlint/conformance/tester.ts b/apps/oxlint/conformance/tester.ts index 8381033eec261..c2b7733f8a97d 100644 --- a/apps/oxlint/conformance/tester.ts +++ b/apps/oxlint/conformance/tester.ts @@ -119,8 +119,6 @@ const testCase: TestCaseWithoutCode = { ] }; -const config = {}; - ------------- Script setup ends ------------- ## 3. Run the test @@ -164,20 +162,17 @@ const testCase: TestCaseWithoutCode = { ], }; -const config = {}; - // ----------------------------------------------------------------------------- // Run test case with both ESLint and Oxlint // ----------------------------------------------------------------------------- -runBoth(ruleName, isInvalid, code, testCase, config); +runBoth(ruleName, isInvalid, code, testCase); function runBoth( ruleName: string, isInvalid: boolean, code: string, testCase: TestCaseWithoutCode, - config?: Record | null, ) { testCase = { code, ...testCase }; @@ -194,24 +189,17 @@ function runBoth( console.log("--------------------"); console.log("ESLint"); console.log("--------------------"); - runOne(ESLintRuleTester, rule, valid, invalid, config); + runOne(ESLintRuleTester, rule, valid, invalid); console.log("\n--------------------"); console.log("Oxlint"); console.log("--------------------"); - config = { ...config, eslintCompat: true }; - runOne(OxlintRuleTester, rule, valid, invalid, config); + runOne(OxlintRuleTester, rule, valid, invalid); } -function runOne( - RuleTester: any, - rule: Rule, - valid: ValidTestCase[], - invalid: InvalidTestCase[], - config?: Record | null, -) { +function runOne(RuleTester: any, rule: Rule, valid: ValidTestCase[], invalid: InvalidTestCase[]) { try { - const tester = new RuleTester(config); + const tester = new RuleTester(); tester.run("my-rule", rule, { valid, invalid }); console.log("No errors"); } catch (err) {