This is what worked for me:

  1. First install the appropriate eslint plugin:
Copy   $ npm i --save-dev eslint-plugin-react-hooks
  1. Add it into your .eslintrc together with default config:
Copy  {
    "plugins": [
      ...
      "react-hooks"
    ],
    "rules": {
      ...
      "react-hooks/rules-of-hooks": "error",
      "react-hooks/exhaustive-deps": "warn"
    }
    ...
  1. Install the eslint configuration template "react-app":
Copy  $ npm i --save-dev eslint-config-react-app
  1. In your .eslintrc extend from the newly installed configuration:
Copy  {
    ...
    "extends": "react-app"
  1. Make sure you have the proper peer dependencies of the new package, e.g. I had to do:
Copy  $ npm i --save-dev eslint-plugin-flowtype
  1. Make sure your eslint package is version 5+ e.g. 5.16.0 works, higher should also work (but beware that higher eslint also requires newer nodejs).
Copy  $ npm i --save-dev eslint@^5.0.0
  1. Restart VSCode
  2. Press Cmd-Shift-U to open the output terminal, switch to Eslint in the dropdown menu and check that it loaded without errors.
Answer from Darko Maksimovic on Stack Overflow
🌐
npm
npmjs.com › package › eslint-plugin-react-hooks
eslint-plugin-react-hooks - npm
// eslint.config.js import reactHooks from 'eslint-plugin-react-hooks'; import { defineConfig } from 'eslint/config'; export default defineConfig([ reactHooks.configs.flat.recommended, ]);
      » npm install eslint-plugin-react-hooks
    
Published   Oct 24, 2025
Version   7.0.1
Homepage   https://react.dev/
🌐
React
react.dev › reference › eslint-plugin-react-hooks
eslint-plugin-react-hooks – React
The lints cover both fundamental ... rules-of-hooks) and issues flagged by React Compiler. React Compiler diagnostics are automatically surfaced by this ESLint plugin, and can be used even if your app hasn’t adopted the compiler yet. When the compiler reports a diagnostic, it means that the compiler was able to statically detect a pattern that is not supported ...
Discussions

reactjs - Integration of eslint-plugin-react-hooks/recommended with eslint.config.js - Stack Overflow
I struggle a lot to configure eslint-plugin-react-hooks/recommended using eslint's new configuration file (eslint.config.js). Using the previous eslint configuration (.eslintrc.js) would have resul... More on stackoverflow.com
🌐 stackoverflow.com
eslint-plugin-react-hooks & "Flat Config" (ESLint 9)
And either way, updating the docs ...ge/eslint-plugin-react-hooks? Note: this was also filed as reactjs/react.dev#6430. I'm posting this issue here as a reference & cross-linking it to the table in eslint/eslint#18093. If there's anything technical blocking the extension from working with flat ... More on github.com
🌐 github.com
108
February 13, 2024
Bug: "ESLint couldn't determine the plugin "react-hooks" uniquely." error occurs while committing file
Node version: 18.13.0 npm version: ... version: Not installed Operating System: Mac OS 13.3.1 ... Recently I had changed the folder structure of my nextjs project. Since this is the first project I am working with nextJS 13 version, I was experimenting to folder structure, where I had kept the app folder on the root and then later added app folder on src file. ... Oops! Something went wrong! :( ESLint: 8.44.0 ESLint couldn't determine the plugin "react-hooks" ... More on github.com
🌐 github.com
3
1
July 14, 2023
Bug: eslint-plugin-react-hooks not flagging hook used as value
However, the plugin-react-compiler is catching this error that the hooks plugin is not. Resulting in the file silently failing to be optimized. React version: 19.2.0 eslint-plugin-react-hooks: 7.0.0 More on github.com
🌐 github.com
1
October 15, 2025
Top answer
1 of 4
10

When I tried the config snippet in the question by @Jonathan Kasser, I got an error: TypeError: context.getSource is not a function.

The solution is to use fixupPluginRules from @eslint/compat (you need to install this), so my eslint.config.js has a separate object in the config array:

import { fixupPluginRules } from "@eslint/compat";

  // Even though eslint-plugin-react-hooks exposes configs.recommended, it is not yet compatible with the flat file config, 
  // because it has plugins: [ 'react-hooks' ] property, but plugins should be an object
  // Once it is supported, replace with: eslintPluginReactHooks.configs.recommended,
  {
    plugins: {
      "react": reactPlugin, // remove this if you already have another config object that adds the react plugin
      "react-hooks": fixupPluginRules(eslintPluginReactHooks),
    },
    rules: {
      ...eslintPluginReactHooks.configs.recommended.rules,
    },
  },

Resources

  • https://github.com/t3-oss/create-t3-turbo/issues/984#issuecomment-2210934687

Proof it works

I've confirmed this by having a code that should error, and saw the error:

  const [first, setfirst] = useState("");
  useEffect(() => {
    console.log(first);
  }, []);
8:6  warning  React Hook useEffect has a missing dependency: 'first'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
2 of 4
4

[email protected] was released a few weeks ago with "stable" eslint v9 support. If you can upgrade, then see https://github.com/facebook/react/issues/28313#issuecomment-2408157792 for a sample configuration for now.

Also, follow this thread if interested in documentation refresh

🌐
GitHub
github.com › facebook › react › issues › 28313
eslint-plugin-react-hooks & "Flat Config" (ESLint 9) · Issue #28313 · facebook/react
February 13, 2024 - 👋 Coming over from eslint/eslint#18093: ESLint is migrating to a new "flat config" format that will be the default in ESLint v9. It doesn't look like eslint-plugin-react-hooks has documented support yet. But, based on searching around (e...
Author   JoshuaKGoldberg
🌐
GitHub
github.com › eslint › eslint › discussions › 17367
Bug: "ESLint couldn't determine the plugin "react-hooks" uniquely." error occurs while committing file · eslint/eslint · Discussion #17367
July 14, 2023 - There was an error while loading. Please reload this page. ... This means that you have more than one config specifying react-hooks as a plugin and they are not using the same version.
Author   eslint
🌐
GitHub
github.com › facebook › react › tree › main › packages › eslint-plugin-react-hooks
react/packages/eslint-plugin-react-hooks at main · facebook/react
// eslint.config.js import reactHooks from 'eslint-plugin-react-hooks'; import { defineConfig } from 'eslint/config'; export default defineConfig([ reactHooks.configs.flat.recommended, ]);
Author   facebook
🌐
GitHub
github.com › facebook › react › issues › 34862
Bug: eslint-plugin-react-hooks not flagging hook used as value · Issue #34862 · facebook/react
October 15, 2025 - I only added the hooks plugin as the release notes say: If you have already installed eslint-plugin-react-compiler, you can now remove it and use eslint-plugin-react-hooks@latest
Author   UltimateGG
Find elsewhere
🌐
Reddit
reddit.com › r/reactjs › how to use eslint-plugin-react and eslint-plugin-react-hooks, just for myself?
r/reactjs on Reddit: How to use eslint-plugin-react and eslint-plugin-react-hooks, just for myself?
January 10, 2025 -

Forgive me if this question is poorly worded or misinformed; I'm new to using NPM.

My team has eslint installed as a dev dependency in our project to ensure high code quality. However, we don't use the eslint-plugin-react or eslint-plugin-react-hooks packages. I'd like to install them so that I can follow the best React practices when coding, without actually making changes to the official dependencies used by all developers. Is there a way to go about this (eg, modify a personal "packages.json" that is separate from the project's but will still lint my company's project)?

🌐
GitHub
github.com › facebook › react › issues › 35283
Bug: eslint-plugin-react-hooks not throwing "Hooks may not be referenced as normal values" error · Issue #35283 · facebook/react
December 4, 2025 - Per the React Compiler v1.0 announcement, I removed eslint-plugin-react-compiler, bumped eslint-plugin-react-hooks to the latest version (7.0.1), and made the eslint config changes accordingly. All other rules, including the new ones, seem to work as expected, except this one seems to have disappeared (I only noticed because our codebase has many instances of this that we've been planning to fix at some point before enabling the compiler).
Author   jsladerman
🌐
Max Rozen
maxrozen.com › react-hooks-eslint-plugin-saved-hours-debugging-useeffect
How the React Hooks ESLint plugin saved me hours debugging useEffect - Max Rozen
To ignore, add // eslint-disable-next-line to the line before. Since enabling the react-hooks/exhaustive-deps rule, I've already saved myself hours of head scratching and general outrage by saving myself from committing buggy code several times. Do yourself a favour and check if you've got the rule enabled. (Shameless plug for the useEffect book I wrote below) A few years ago when I worked at Atlassian, a useEffect bug I wrote took down part of Jira for roughly one hour.
🌐
GitHub
github.com › eslint › eslint › issues › 12637
ESLint couldn't find the plugin "eslint-plugin-react-hook". · Issue #12637 · eslint/eslint
December 4, 2019 - (The package "eslint-plugin-react-hook" was not found when loaded as a Node module from the directory "/Users/adamklepacz/Documents/projects/eoc".) It's likely that the plugin isn't installed correctly.
Author   adamklepacz
🌐
Stack Overflow
stackoverflow.com › questions › tagged › eslint-plugin-react-hooks
Newest 'eslint-plugin-react-hooks' Questions - Stack Overflow
One by a user typing (debounced), and one by a button to retry. react-hooks/exhaustive-deps's suggestion actually causes a bug for me, as ... ... Here is a demo: https://stackblitz.com/edit/react-ts-rttbjn This demo is working as I want. But in PagingList.tsx, an ESLint warning will throw: ESLint: React Hook useEffect has a missing dependency: '...
🌐
GitHub
github.com › reactwg › react-compiler › discussions › 18
Using `eslint-plugin-react-hooks` together with `eslint-plugin-react-compiler` · reactwg/react-compiler · Discussion #18
Compilation failed: useCustomHook.tsx React Compiler has skipped optimizing this component because one or more React ESLint rules were disabled React Compiler only works when your components follow all the rules of React, disabling them may result in unexpected or incorrect behavior. Found suppression `eslint-disable-next-line react-hooks/exhaustive-deps` Suggestions: 'Remove the ESLint suppression and address the React error'
Author   reactwg
🌐
React
legacy.reactjs.org › docs › hooks-rules.html
Rules of Hooks – React
That’s what allows React to correctly preserve the state of Hooks between multiple useState and useEffect calls. (If you’re curious, we’ll explain this in depth below.) Don’t call Hooks from regular JavaScript functions. Instead, you can: ... By following this rule, you ensure that all stateful logic in a component is clearly visible from its source code. We released an ESLint plugin called eslint-plugin-react-hooks that enforces these two rules.
🌐
O'Reilly
oreilly.com › library › view › learn-react-hooks › 9781838641443 › 3eb17a6d-8048-43d1-899b-228ae7028042.xhtml
Setting up eslint-plugin-react-hooks - Learn React Hooks [Book]
October 18, 2019 - We are now going to set up the React Hooks eslint plugin to automatically enforce the rules of Hooks. Let's start installing and enabling the eslint plugin: ... We use the --save-dev flag here, because eslint and its plugins are not required to be installed when deploying the app.
Author   Daniel Bugl
Published   2019
Pages   426
🌐
npm
npmjs.com › package › eslint-plugin-react
eslint-plugin-react - npm
April 3, 2025 - It is also possible to install ESLint globally rather than locally (using npm install -g eslint). However, this is not recommended, and any plugins or shareable configs that you use must be installed locally in either case. ... If you are using the new JSX transform from React 17, extend react/jsx-runtime in your eslint config (add "plugin:react/jsx-runtime" to "extends") to disable the relevant rules.
      » npm install eslint-plugin-react
    
Published   Apr 03, 2025
Version   7.37.5
Author   Yannick Croissant
🌐
GitHub
github.com › reactjs › react.dev › issues › 6430
How to configure `eslint-plugin-react-hooks` in `eslint.config.js` · Issue #6430 · reactjs/react.dev
November 12, 2023 - 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 ...
Author   rakleed