Skip to main content
Version 1.0 is a major update that moves to ESLint 9’s flat config format and unbundles third-party rules to give you more control over your linting setup. The flat config files don’t allow nesting configuration files in subdirectories — instead, all nesting must be in one configuration file. If you already have an ESLint configuration in your project, review the table below to see what’s changed: After reviewing the above changes, proceed with the steps below to migrate to the latest version.

Migrate your ESLint config

1. Review your current config

Before migrating, open your existing .eslintrc.* file and note:
  • Any custom rules you’ve added or modified
  • Any additional plugins you’re using
  • Any overrides for specific file patterns
  • Any env or globals settings
You’ll need to translate these to flat config format. Keep your old config file for reference until migration is complete.

2. Update dependencies

Upgrade to ESLint 9 and the new package version by running the following command:

3. Set up ESM

ES modules is required for a flat configuration, so you’ll need to ensure your package.json includes "type": "module":

4. Create a new ESLint config file

Create an eslint.config.js file in your project root. Start with either the minimal or recommended setup below, then add your custom rules. Read more about each addition in the Recommended setup section of the overview. Minimal setup (HubSpot UI extensions rules only):
Recommended setup (replaces previously bundled configs, plus extras):

5. Migrate your custom configuration

Refer to your old config file and translate your customizations to flat config format. Custom rules:
Overrides (file-specific rules):
Globals:
Environments: Flat config uses globals instead of env.
For more details, see the official ESLint migration guide.

6. Testing and cleanup

Run ESLint to verify your migration:
Once you’ve verified that everything works, you can delete your old .eslintrc.* file.

Troubleshooting

ESLint seems to ignore your new config

ESLint 9 looks for eslint.config.js by default and ignores .eslintrc.* files. If it seems like ESLint is ignoring your new config, make sure:
  1. You created eslint.config.js in your project root.
  2. The file is correctly exporting an array (check for syntax errors).

Error: Cannot use require() to import an ES module

Your config file is being loaded as CommonJS. Make sure:
  1. Your package.json has "type": "module".
  2. Your config file is named eslint.config.js (not .cjs).

Errors about missing plugins or rules

If you see errors like Definition for rule 'react/prop-types' was not found, you’re using a rule from a plugin that was previously bundled but is now opt-in. Either:
  1. Install the plugin and add it to your config (see recommended setup).
  2. Remove the rule if you no longer need it.

Error: Invalid option ‘extends’

Flat config uses a different structure than legacy config. You can’t use extends, env, plugins (as an array), or overrides the same way. See Step 5 above for translation examples.
Last modified on March 29, 2026