test: freeze eslintrc rule maps before the flat-config migration (1/5)
| Stage | MR | What it does |
|---|---|---|
| 1 | !170 (merged) ← you are here | freeze the eslintrc rule maps |
| 2 | !171 (merged) | 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
Records what each of the seven eslintrc configs resolves to today, as JSON rule maps, so the flat configs that replace them can be asserted equal rather than eyeballed. No config, rule or test changes.
Why it goes first, on its own
You can verify these 20k lines with one command. On this branch the generator's inputs still exist and ESLint is still pinned to 8:
yarn install
yarn generateFixtures
git diff --exit-code tests/fixtures/rule-maps/That reproduces all seven fixtures byte for byte. I've run it; git reports no change. The window closes at stage 4, when the eslintrc configs are deleted — this is the only point at which the fixtures are checkable against their source.
Reviewing this
Don't read the JSON; re-run the command. What wants a human eye is scripts/generateRuleMapFixtures.js (72 lines) and whether its normalisation is faithful: severities to strings, keys sorted, one map per sample file so overrides are captured per file type.
Four samples per config, because eslintrc overrides resolve differently per file type — sample.vue catches import/no-default-export flipping to off in SFCs, sample.test.ts the test-only relaxations.
A bare severity serialises as "error" rather than ["error"] — 70% of entries — so most rules are one line and the JSON is a third smaller.
Sanity check: base 451 rules, default 550, vue 278, jest 22, i18n 5, tailwind 5, typescript 451 (482 for sample.ts).
A bug the new devDependencies expose
typescript and @typescript-eslint/parser are added, pinned to v7 to match the plugin. They're needed because the typescript config could never be loaded from a clean install — both are required to load @typescript-eslint/eslint-plugin and neither was declared, so the config worked only because the README told consumers to install them. Stage 4 makes them explicit optional peers.
Verification
499 passing on ESLint 8.57.1, unchanged from main. No changeset.