Repository navigation
build(npm): migrate ESLint to flat config and bump to v10 - #65
Merged
Merged
Conversation
ESLint 9 made flat config the default; ESLint 10 removed the legacy `.eslintrc` path entirely, and `ESLINT_USE_FLAT_CONFIG=false` no longer opts back in. So eslint v10 cannot land as a dependency bump (Renovate's #53) — the config has to move first. Port `.eslintrc.json` to `eslint.config.mjs` with no intended behavior change: same base configs (`eslint:recommended` + typescript-eslint `recommended`), the same two rule overrides, and the node/es6/jest `env`s re-expressed as `languageOptions.globals` (flat config has no `env`). Replace `@typescript-eslint/eslint-plugin` + `@typescript-eslint/parser` with the `typescript-eslint` meta package — the canonical v8 flat-config entry point, which composes the `eslint-recommended` rule disables correctly rather than requiring us to hand-wire them. This is unblocked by #57, which bumped typescript-eslint to 8.64.0 (peer range `eslint: ^8.57.0 || ^9.0.0 || ^10.0.0`). At 6.21.0 it hard-crashed under ESLint 10 with `TypeError: scopeManager.addGlobals is not a function`. Verified: `npx eslint src` lints all 8 source files with rules firing (negative control confirmed it catches an injected violation); tsc clean; 84/84 tests pass; full prek suite green. Note: `npm run lint` still only reaches one file, because the script's `src/**/*.ts` glob is expanded by sh (no globstar) down to `src/*/*.ts`. That is a pre-existing bug, not introduced here, and is left for a follow-up rather than folded in — fixing it surfaces 29 errors and 17 warnings across the real source and would reformat all 8 files, which does not belong in a config migration. Refs: #64
This was referenced Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrate ESLint to flat config + v10
Closes #64. Supersedes Renovate's #53, which could not work as a bump.
Why a bump wasn't enough
ESLint 9 made flat config the default; ESLint 10 removed the legacy
.eslintrcpath entirely, and
ESLINT_USE_FLAT_CONFIG=falseno longer opts back in:There was a second blocker until recently:
@[email protected]hard-crashedunder ESLint 10 (its bundled
[email protected]yields a scope manager that ESLint 10'sSourceCode.finalize()rejects):#57 cleared that by bumping typescript-eslint to
8.64.0, whose peer range iseslint: ^8.57.0 || ^9.0.0 || ^10.0.0. So the plugin side was already ready; only theconfig format was left.
What changed
.eslintrc.json→eslint.config.mjs. Faithful port, no intended behavior change:same base configs (
eslint:recommended+ typescript-eslintrecommended), the sametwo rule overrides (
no-explicit-any: warn,explicit-function-return-type: off), andthe
node/es6/jestenvs re-expressed aslanguageOptions.globals(flat config hasno
env).eslint8.57→10.7.0.@typescript-eslint/eslint-plugin+@typescript-eslint/parser→ thetypescript-eslintmeta package. This is the canonical v8 flat-config entry point and composes the
eslint-recommendedrule-disables correctly, instead of us hand-wiring them. Bothpackages remain installed transitively.
@eslint/jsandglobals(the flat-config equivalents of theextendsandenvkeys that went away).
Node 24 satisfies ESLint 10's engines (
^20.19.0 || ^22.13.0 || >=24).Verification
npx eslint src— lints all 8 source files, rules firing correctly.const __probe: any = 1; let __unused = __probe;intosrc/commit.tsand confirmed ESLint caught it (prefer-const,@typescript-eslint/no-unused-vars,no-explicit-any), then reverted. The config is notsilently linting nothing.
tscclean · 84/84 tests pass ·just precommitfully green.dist/untouched.npm run linthas never linted the real sourceNot introduced here, and not fixed here — filed separately.
The lint and format scripts use
src/**/*.ts. npm runs scripts throughsh, which has noglobstar, so
**degrades to*and the pattern collapses tosrc/*/*.ts:One file.
src/commit.ts,src/commit-runner.ts, andsrc/retry.tshave never beenlinted or formatted, and the "Lint & Format" CI job has been passing on that basis.
Running ESLint over the real tree surfaces 29 errors and 17 warnings across 8 files, and
prettier --list-different srcreports all 8 files as unformatted. Most errors areno-require-importsin test mocks (defensible in tests, needs a rule override). The only twoin production source are minor and neither is a correctness bug:
src/commit-runner.ts:177—preserve-caught-error(nocauseon a rethrow; new v10 rule)src/commit.ts:85—no-useless-assignment(dead initializer onbytesRead; harmless)I deliberately kept that out of this PR: fixing the glob means triaging 46 findings and
reformatting the entire source, which has a different risk profile and would make both changes
unreviewable. This PR's ESLint 10 support is verified directly via
npx eslint srcregardlessof the script bug.