Eeslint

eslint/v8-to-v9-config

Migrate ESLint configuration from v8 to v9 flat config format

transformationmigrationeslintv8v9
Public
7 executions
2 stars
How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

Documentation

@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
  • globalslanguageOptions.globals
  • parserOptionslanguageOptions.parserOptions
  • overrides → separate configuration objects in the array

Step 2: Rule Schema Updates

Updates rules with breaking schema changes in ESLint v9:

RuleMigration
no-unused-varsAdds caughtErrors: 'none' (v9 changed default to 'all')
no-useless-computed-keyAdds enforceForClassMembers: false (v9 changed default to true)
no-sequencesMigrates allowInParentheses to new format
no-constructor-returnEnsures proper array format
camelcaseValidates allow option (must be array of strings)
no-restricted-importsRestructures 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/PluginMigration
eslint:recommendedjs.configs.recommended
eslint:alljs.configs.all
prettier✅ Fully migrated
@angular-eslint/*✅ Fully migrated
ember✅ Fully migrated

⚠️ Unsupported plugins and extends: For plugins not listed above, this codemod will:

  1. Comment out the unsupported extends/plugins
  2. Add TODO comments explaining the required manual follow-up:
js

Check 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

Resources

Ready to contribute?

Build your own codemod and share it with the community.