Eslint Plugin React Hooks

The 'eslint-plugin-react-hooks' plugin enforces the Rules of Hooks to avoid bugs. It assumes that any function starting with “use” and a capital letter right after it is a Hook. The rule enforces that calls to Hooks are either inside a PascalCase function (assumed to be a component) or another useSomething function (assumed to be a custom Hook). It also ensures that hooks are called in the same order on every render.

Since React Compiler reached v1.0 in October 2025, this plugin's recommended presets also ship additional compiler-powered lint rules (covering things like exhaustive-deps, purity, and correct use of refs) that check your code follows the Rules of React in general, not just the Rules of Hooks — you don't need to install the compiler itself to benefit from these lint rules.