You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to configure eslint-plugin-react-hooks in eslint.config.js #6430
Starting with the next version 9, ESLint will deprecate the current eslintrc format and will default use the new flat config format (eslint.config.js). Already from version 8.2.23 you can fully use the flat config format. Still, neither the README (which is used as a description for the NPM package) nor the documentation says anything about how to configure it correctly. And also no one answered the question on StackOverflow about this. Please add this information to the documentation.
changed the title [-]How to install `eslint-plugin-react-hooks` in `eslint.config.js`[/-][+]How to configure `eslint-plugin-react-hooks` in `eslint.config.js`[/+]on Nov 12, 2023
My app is in CRA JS and am trying to migrate from .eslintrc to eslint.config.mjs by using the migrator. This is my eslint.config.mjs file after migration:
Activity
[-]How to install `eslint-plugin-react-hooks` in `eslint.config.js`[/-][+]How to configure `eslint-plugin-react-hooks` in `eslint.config.js`[/+]nikitaNaredi commentedon Sep 27, 2024
My app is in CRA JS and am trying to migrate from .eslintrc to eslint.config.mjs by using the migrator. This is my eslint.config.mjs file after migration:
Package.json:
now when am trying to build the project am getting:
Definition for rule 'react-hooks/exhaustive-deps' was not found react-hooks/exhaustive-deps. Please help.Neoxs commentedon Mar 23, 2025
To configure eslint-plugin-react-hooks in your eslint.config.js, you can use the following line:
However, please note that the react-hooks plugin does not yet fully support the new flat config format.
For a more detailed guide and insights into the challenges I faced during my ESLint v9 migration, you can check out my blog article:
🚀 Just completed an ESLint v9 migration, and wow… what a ride! 😵💫
I encountered breaking changes, weird errors, and unexpected surprises—but I documented everything to help you avoid the same pitfalls.
If you’re planning to upgrade (or still hesitating), this guide might save you some headaches:
📖 neoxs.me/blog/migration-to-eslint-v9