test: migrate to ESLint 9 and convert the RuleTester specs (2/5)
| Stage | MR | What it does |
|---|---|---|
| 1 | !170 (merged) | freeze the eslintrc rule maps |
| 2 | !171 (merged) ← you are here | ESLint 9 + RuleTester specs |
| 3 | !172 (merged) | the seven flat configs (additive, deletes nothing) |
| 4 | !173 (merged) | delete eslintrc, rewire entrypoints — cuts the release |
| 5 | !174 (merged) | remove the parity gate now it has served its purpose |
Merge in order; each MR targets the one before it, so the diff here is only this stage. Only stage 4 carries a changeset, so only stage 4 publishes.
What this does
Drops ESLint 8 and converts every spec to flat config; the peer range becomes ^9.0.0. First time the suite has run against ESLint 9 at all — the specs were eslintrc-shaped, so they only ever exercised ESLint 8. lib/configs/ is untouched.
Two things worth a close look
RuleTester.setDefaultConfig is gone, and that is a behaviour fix. It mutated RuleTester globally, so under mocha it leaked into every spec file loaded after it. Now per-instance, in tests/helpers/rule-tester-configs.js.
Two rule files change for eslint-plugin-vue 10 — it dropped the default accessor on its CJS exports, and getVueComponentDefinitionType gained a context parameter. API adaptations; neither changes what a rule reports.
Smaller notes
Some test cases in require-valid-i18n.constants.js change text. ESLint 9's checkDuplicateTestCase rejects a duplicate valid case outright, and three strings were duplicated across the arrays two specs concatenate. They're replaced with distinct equivalents rather than deleted, so each list still demonstrates the syntaxes it was written for.
Also declares globals, semver and @eslint/js, all used at runtime and resolved only by hoisting. The lockfile is de-duplicated in its own commit.
Known interim state
Between this stage and stage 4, lib/configs/vue.js references vue/component-tags-order, which eslint-plugin-vue 10 removed. No consumer sees it (no changeset, no release), but it argues against leaving stages 2–3 merged for long without 4.
Verification
499 passing, unchanged from stage 1, on eslint 9.39.5, eslint-plugin-vue 10.11.0, vue-eslint-parser 10.4.1, @typescript-eslint/parser 8.70.0, eslint-plugin-jest 29.16.6, eslint-config-prettier 10.1.8. No changeset.
test-on-gitlab and test-on-design-system fail here and at every later stage — they lint downstream repos still on the eslintrc configs. Both are allow_failure: true.