| Before (v0.x) | After (v1.0) |
|---|---|
| ESLint 8 | ESLint 9+ required |
Legacy config (.eslintrc.*) | Flat config (eslint.config.js) |
Bundled eslint:recommended | Install separately via @eslint/js |
Bundled eslint-plugin-react recommended rules | Install and configure separately |
Bundled eslint-plugin-react-hooks | Install and configure separately |
Bundled eslint-config-prettier | Install and configure separately |
CommonJS (require()) | ESM (import) |
Migrate your ESLint config
1. Review your current config
Before migrating, open your existing.eslintrc.* file and note:
- Any custom
rulesyou’ve added or modified - Any additional
pluginsyou’re using - Any
overridesfor specific file patterns - Any
envorglobalssettings
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 yourpackage.json includes "type": "module":
4. Create a new ESLint config file
Create aneslint.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):
5. Migrate your custom configuration
Refer to your old config file and translate your customizations to flat config format. Custom rules:globals instead of env.
6. Testing and cleanup
Run ESLint to verify your migration:.eslintrc.* file.
Troubleshooting
ESLint seems to ignore your new config
ESLint 9 looks foreslint.config.js by default and ignores .eslintrc.* files. If it seems like ESLint is ignoring your new config, make sure:
- You created
eslint.config.jsin your project root. - 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:- Your
package.jsonhas"type": "module". - Your config file is named
eslint.config.js(not.cjs).
Errors about missing plugins or rules
If you see errors likeDefinition 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:
- Install the plugin and add it to your config (see recommended setup).
- 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 useextends, env, plugins (as an array), or overrides the same way. See Step 5 above for translation examples.