@eslint/v8-to-v9-config
Migrate ESLint v8 to v9 format automatically.
Quick Start
bash
After running, install dependencies:
bash
Then test your config:
bash
Migration Steps
Step 1: Config File Conversion
Converts .eslintrc.js, .eslintrc.json, .eslintrc.yaml, and .eslintrc.yml to the new config format (eslint.config.mjs).
What gets migrated:
- env settings → languageOptions.globals
- globals → languageOptions.globals
- parserOptions → languageOptions.parserOptions
- overrides → separate configuration objects in the array
Step 2: Rule Schema Updates
Updates rules with breaking schema changes in ESLint v9:
| Rule | Migration |
|---|---|
| no-unused-vars | Adds caughtErrors: 'none' (v9 changed default to 'all') |
| no-useless-computed-key | Adds enforceForClassMembers: false (v9 changed default to true) |
| no-sequences | Migrates allowInParentheses to new format |
| no-constructor-return | Ensures proper array format |
| camelcase | Validates allow option (must be array of strings) |
| no-restricted-imports | Restructures paths configuration |
Step 3: JSDoc Rules Migration
The require-jsdoc and valid-jsdoc rules were removed in ESLint v9. This codemod migrates them to eslint-plugin-jsdoc.
After running, install the plugin:
bash
⚠️ Manual step: If you have custom JSDoc settings, look for // TODO: Migrate settings manually comments in your config and update them accordingly.
Step 4: Comment Cleanup
Fixes ESLint comment syntax that became invalid in v9:
- Duplicate /* eslint */ comments: Removes duplicate rule comments for the same rule
- Malformed /* exported */ comments: Fixes to proper format
Step 5: Extends & Plugin Migration
Supported presets (fully migrated):
| Config/Plugin | Migration |
|---|---|
| eslint:recommended | → js.configs.recommended |
| eslint:all | → js.configs.all |
| prettier | ✅ Fully migrated |
| @angular-eslint/* | ✅ Fully migrated |
| ember | ✅ Fully migrated |
⚠️ Unsupported plugins and extends: For plugins not listed above, this codemod will:
- Comment out the unsupported extends/plugins
- Add TODO comments explaining the required manual follow-up:
jsCheck the plugin's documentation for v9 migration instructions.
Step 6: Ignore File Migration
ESLint v9 uses the ignores property instead of .eslintignore files.
This codemod attempts to migrate .eslintignore content to the config file's ignores array.
⚠️ Manual step: The codemod attempts to delete .eslintignore files, but may fail due to permissions. After running, verify and remove manually if needed:
bash
Before (.eslintrc.json):
json
After (eslint.config.mjs):
javascript