Skip to content

chore: upgrade ESLint to v10 with flat config#1045

Open
brunoborges wants to merge 2 commits into
mainfrom
chore/upgrade-eslint-10-flat-config
Open

chore: upgrade ESLint to v10 with flat config#1045
brunoborges wants to merge 2 commits into
mainfrom
chore/upgrade-eslint-10-flat-config

Conversation

@brunoborges

Copy link
Copy Markdown
Contributor

Summary

Upgrades ESLint from 8.57.0 → 10.5.0. ESLint 10 removes support for the legacy .eslintrc format 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 eslint to 10 without coordinating the @typescript-eslint upgrade and the flat-config migration triggers an ERESOLVE peer conflict (the old @typescript-eslint/eslint-plugin caps eslint at ^9) and leaves the action with an unsupported .eslintrc.js.

Changes

  • Bump eslint 8.57.010.5.0 and eslint-plugin-jest29.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, unmaintained eslint-plugin-node (broken on ESLint 9+) with its maintained fork eslint-plugin-n (18.1.0). The only 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.jseslint.config.mjs and .eslintignore → 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).

Behavior preservation

  • preserve-caught-error (new in ESLint 10's recommended set) is explicitly disabled to keep the previous lint behavior. Adopting it requires attaching an Error cause (ES2022 target) and is left as a follow-up.
  • Only dev/lint dependencies change. Runtime dependencies are frozen at their main versions, so the built dist/ output is byte-for-byte unchanged (no dist/ diff in this PR).

Validation

  • npm ci reproduces the lockfile
  • npm run lint (ESLint 10 flat config) passes clean
  • npm run format-check passes
  • npm run builddist/ identical to main
  • npm test — 762/763 (the one failure is a sandbox network error unrelated to this change)
  • npm audit --audit-level=high — no high-severity advisories

Note on auto-sync

.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.

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>
@brunoborges brunoborges requested a review from a team as a code owner June 22, 2026 21:46
Copilot AI review requested due to automatic review settings June 22, 2026 21:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.0 and adjust related lint dependencies (TypeScript ESLint via typescript-eslint, replace eslint-plugin-node with eslint-plugin-n, add @eslint/js and globals).
  • Replace .eslintrc.js and .eslintignore with eslint.config.mjs using flat config and equivalent ignores/overrides.
  • Update lint / lint:fix npm 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

Comment thread package.json Outdated
@brunoborges brunoborges requested a review from gdams June 22, 2026 21:51
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Internal refactors/chore work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants