Skip to content

feat: upgrade ESLint to v10 and migrate to flat config#516

Open
nx-plugin-for-aws wants to merge 1 commit intomainfrom
feat/eslint-10-upgrade
Open

feat: upgrade ESLint to v10 and migrate to flat config#516
nx-plugin-for-aws wants to merge 1 commit intomainfrom
feat/eslint-10-upgrade

Conversation

@nx-plugin-for-aws
Copy link
Copy Markdown
Collaborator

@nx-plugin-for-aws nx-plugin-for-aws commented Mar 27, 2026

Reason for this change

ESLint 10 was released with several improvements and new recommended rules. The workspace was using ESLint 9 with legacy .eslintrc.json configuration files, which are no longer supported in ESLint 10. Additionally, user projects generated by the plugin should also use ESLint 10.

Description of changes

ESLint v10 upgrade (workspace):

  • Updated eslint from 9.39.4 to 10.1.0
  • Added @eslint/js@10.0.1 and typescript-eslint@8.57.2 as direct dependencies
  • Added jsonc-eslint-parser@3.1.0 as a direct dependency
  • Converted .eslintrc.json to eslint.config.mjs for root, packages/nx-plugin, and e2e
  • Removed .eslintignore (patterns moved into flat config ignores)
  • Updated nx.json target defaults and named inputs
  • Fixed new ESLint 10 recommended rule violations

ESLint v10 for generated user projects:

  • Added eslint@10.1.0, @eslint/js@10.0.1, @eslint/compat@2.0.3, typescript-eslint@8.57.2 to versions.ts and configureEslint()
  • Override React ESLint plugin versions pinned by @nx/react with latest compatible versions (eslint-plugin-react@7.37.5, eslint-plugin-react-hooks@5.2.0, eslint-plugin-import@2.32.0, eslint-plugin-jsx-a11y@6.10.2)
  • Added fixupEslintReactConfig() to wrap nx.configs['flat/react'] with @eslint/compat's fixupConfigRules(), since React ESLint plugins use APIs removed in ESLint 10 (e.g. context.getFilename())
  • Added package.json overrides/resolutions for all package managers (npm, yarn, pnpm) to handle strict peer dependency resolution

Description of how you validated changes

  • All 1501 unit tests pass with updated snapshots
  • Full build passes (pnpm nx run-many --target build --all)
  • Lint passes on all projects (0 errors)
  • End-to-end tested: created a test workspace with React website, infra, and tRPC API projects — all lint successfully with ESLint 10.1.0
  • All 14 CI checks pass (including smoke tests for npm, pnpm, yarn, bun, react-website, dungeon-adventure, etc.)

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 27, 2026

Codecov Report

❌ Patch coverage is 76.47059% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.70%. Comparing base (724a99d) to head (a16756a).
⚠️ Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
packages/nx-plugin/src/ts/lib/eslint.ts 66.66% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #516      +/-   ##
==========================================
- Coverage   90.80%   90.70%   -0.10%     
==========================================
  Files          90       90              
  Lines        3207     3218      +11     
  Branches      705      707       +2     
==========================================
+ Hits         2912     2919       +7     
- Misses        122      124       +2     
- Partials      173      175       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Upgrade the workspace and all generated user projects to ESLint 10.

Workspace changes:
- Update eslint from 9.x to 10.1.0
- Migrate .eslintrc.json to eslint.config.mjs (flat config)
- Remove .eslintignore (patterns moved into flat config)
- Fix new ESLint 10 recommended rule violations

Generated project changes:
- Vend eslint@10.1.0, @eslint/js, @eslint/compat, typescript-eslint
- Override React ESLint plugin versions pinned by @nx/react
- Wrap nx.configs['flat/react'] with @eslint/compat fixupConfigRules
  to handle APIs removed in ESLint 10 (e.g. context.getFilename)
- Add overrides/resolutions for npm/yarn/pnpm peer dep resolution
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants