Summary
Upgrade eslint and its ecosystem from 8.x to 9.x+. This is the biggest tooling migration as ESLint 9+ requires the new flat config format (eslint.config.js), replacing the legacy .eslintrc format.
Current → Target
| Package |
Current |
Latest |
eslint |
8.57.1 |
10.0.2 |
eslint-config-prettier |
8.5.0 |
10.1.8 |
eslint-plugin-prettier |
4.2.1 |
5.5.5 |
eslint-plugin-jest |
27.1.3 |
29.15.0 |
eslint-plugin-react-hooks |
4.6.0 |
7.0.1 |
eslint-import-resolver-typescript |
3.5.2 |
4.4.4 |
@typescript-eslint/eslint-plugin |
^8.49.0 |
latest |
@typescript-eslint/parser |
^8.49.0 |
latest |
Why Upgrade
- ESLint 8.x is end-of-life
- Flat config is the future — all new plugins target it
- Better performance and simpler configuration
eslint-plugin-react-hooks 7.x has significant improvements
Migration Steps
- Create
eslint.config.js (flat config) to replace existing ESLint config:
# Use the migration helper
npx @eslint/migrate-config .eslintrc.json
- Install updated packages:
yarn add --dev eslint@latest \
eslint-config-prettier@latest \
eslint-plugin-prettier@latest \
eslint-plugin-jest@latest \
eslint-plugin-react@latest \
eslint-plugin-react-hooks@latest \
eslint-import-resolver-typescript@latest \
eslint-plugin-import@latest \
@typescript-eslint/eslint-plugin@latest \
@typescript-eslint/parser@latest
- Convert config — flat config uses JS objects instead of JSON:
extends → ...configs (spread)
plugins → import and reference directly
env → languageOptions.globals
parserOptions → languageOptions.parserOptions
- Update lint scripts in
package.json — flat config auto-discovers eslint.config.js
- Remove old config files — delete
.eslintrc, .eslintrc.json, or .eslintrc.js
- Fix any new lint errors introduced by updated rule defaults
- Run
yarn ci to verify
⚠️ Recommendation
This should be done after the Prettier 3.x upgrade (issue for that exists separately #431 ), since eslint-plugin-prettier and eslint-config-prettier need to be compatible with both ESLint and Prettier versions.
Files Affected
.eslintrc* → eslint.config.js (new file, old file deleted)
package.json — dependency versions, possibly lint script changes
- Potentially some source files if new/stricter rules flag issues
References
Summary
Upgrade
eslintand its ecosystem from 8.x to 9.x+. This is the biggest tooling migration as ESLint 9+ requires the new flat config format (eslint.config.js), replacing the legacy.eslintrcformat.Current → Target
eslinteslint-config-prettiereslint-plugin-prettiereslint-plugin-jesteslint-plugin-react-hookseslint-import-resolver-typescript@typescript-eslint/eslint-plugin@typescript-eslint/parserWhy Upgrade
eslint-plugin-react-hooks7.x has significant improvementsMigration Steps
eslint.config.js(flat config) to replace existing ESLint config:# Use the migration helper npx @eslint/migrate-config .eslintrc.jsonextends→...configs(spread)plugins→ import and reference directlyenv→languageOptions.globalsparserOptions→languageOptions.parserOptionspackage.json— flat config auto-discoverseslint.config.js.eslintrc,.eslintrc.json, or.eslintrc.jsyarn cito verifyThis should be done after the Prettier 3.x upgrade (issue for that exists separately #431 ), since
eslint-plugin-prettierandeslint-config-prettierneed to be compatible with both ESLint and Prettier versions.Files Affected
.eslintrc*→eslint.config.js(new file, old file deleted)package.json— dependency versions, possibly lint script changesReferences