chore: upgrade ESLint to v10 with flat config#1045
Open
brunoborges wants to merge 2 commits into
Open
Conversation
Upgrade ESLint from 8.57.0 to 10.5.0. ESLint 10 removes support for the legacy `.eslintrc` format entirely, so the configuration is migrated to the new flat config (`eslint.config.mjs`). Changes: - Bump `eslint` 8.57.0 -> 10.5.0 and `eslint-plugin-jest` to 29.15.2. - Replace the legacy `@typescript-eslint/eslint-plugin` + `@typescript-eslint/parser` pair with the `typescript-eslint` meta-package (8.62.0), which supports ESLint 10. - Replace the deprecated `eslint-plugin-node` (unmaintained, broken on ESLint 9+) with its maintained fork `eslint-plugin-n` (18.1.0); the single rule in use, `node/no-extraneous-import`, becomes `n/no-extraneous-import`. - Add `@eslint/js` (10.0.1) and `globals` (17.7.0), now required by flat config. - Translate `.eslintrc.js` to `eslint.config.mjs` and `.eslintignore` to the flat config `ignores`, preserving all existing rules and the test-file overrides. - Update the `lint`/`lint:fix` scripts to invoke `eslint` directly (flat config is auto-detected; the `--config ./.eslintrc.js` flag is removed). `preserve-caught-error` (new in ESLint 10's recommended set) is disabled to keep the previous lint behavior; adopting it requires an ES2022 target and is left as a follow-up. Only dev/lint dependencies change, so runtime deps and the built `dist/` output are unchanged. Note: `.eslintrc.js` was previously auto-synced from actions/reusable-workflows. Upstream has not yet published a flat config, so this migration intentionally deviates from that auto-sync until upstream catches up. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR upgrades the repository’s linting toolchain to ESLint v10 and migrates from legacy .eslintrc to the flat config format (eslint.config.mjs), along with the necessary ecosystem/plugin upgrades to maintain compatibility.
Changes:
- Upgrade ESLint to
^10.5.0and adjust related lint dependencies (TypeScript ESLint viatypescript-eslint, replaceeslint-plugin-nodewitheslint-plugin-n, add@eslint/jsandglobals). - Replace
.eslintrc.jsand.eslintignorewitheslint.config.mjsusing flat config and equivalent ignores/overrides. - Update
lint/lint:fixnpm scripts to run ESLint without explicitly specifying the legacy config file.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updates lint scripts and devDependencies to ESLint 10 + flat-config-compatible plugins/packages. |
| package-lock.json | Lockfile updates reflecting the new ESLint/tooling dependency graph. |
| eslint.config.mjs | Introduces the flat ESLint configuration with ignores, TS + Jest setup, and updated n/ rule usage. |
| .eslintrc.js | Removes the legacy ESLint configuration (no longer supported in ESLint 10). |
| .eslintignore | Removes legacy ignore file in favor of flat config ignores. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/5 changed files
- Comments generated: 1
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This was referenced Jun 22, 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.
Summary
Upgrades ESLint from 8.57.0 → 10.5.0. ESLint 10 removes support for the legacy
.eslintrcformat entirely, so this migrates the configuration to the new flat config (eslint.config.mjs).This supersedes the standalone Dependabot bump in #1022, which could not work on its own: bumping
eslintto 10 without coordinating the@typescript-eslintupgrade and the flat-config migration triggers anERESOLVEpeer conflict (the old@typescript-eslint/eslint-plugincapseslintat^9) and leaves the action with an unsupported.eslintrc.js.Changes
eslint8.57.0→10.5.0andeslint-plugin-jest→29.15.2.@typescript-eslint/eslint-plugin+@typescript-eslint/parserpair with thetypescript-eslintmeta-package (8.62.0), which supports ESLint 10.eslint-plugin-node(broken on ESLint 9+) with its maintained forkeslint-plugin-n(18.1.0). The only rule in use,node/no-extraneous-import, becomesn/no-extraneous-import.@eslint/js(10.0.1) andglobals(17.7.0), now required by flat config..eslintrc.js→eslint.config.mjsand.eslintignore→ the flat-configignores, preserving all existing rules and the test-file overrides.lint/lint:fixscripts to invokeeslintdirectly (flat config is auto-detected; the--config ./.eslintrc.jsflag is removed).Behavior preservation
preserve-caught-error(new in ESLint 10'srecommendedset) is explicitly disabled to keep the previous lint behavior. Adopting it requires attaching anErrorcause(ES2022 target) and is left as a follow-up.mainversions, so the builtdist/output is byte-for-byte unchanged (nodist/diff in this PR).Validation
npm cireproduces the lockfilenpm run lint(ESLint 10 flat config) passes cleannpm run format-checkpassesnpm run build—dist/identical tomainnpm test— 762/763 (the one failure is a sandbox network error unrelated to this change)npm audit --audit-level=high— no high-severity advisoriesNote on auto-sync
.eslintrc.jswas previously auto-synced from actions/reusable-workflows. Upstream has not yet published a flat config, so this migration intentionally deviates from that auto-sync until upstream catches up.