# exhaustive-deps

Rule `react-hooks/exhaustive-deps`. Verifies the list of dependencies for Hooks like useEffect and similar

- Source: react-hooks
- Technologies: React
- Kind: correctness
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 201.1M weekly downloads of presets that enable it
- Trend: +35.3% last quarter
- Rank: #76 by reach, #1063 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `react-hooks/exhaustive-deps` | yes | safe | package `eslint-plugin-react-hooks` | [docs](https://react.dev/reference/eslint-plugin-react-hooks/lints/exhaustive-deps) |
| Oxlint | `react/exhaustive-deps` | no | unsafe | plugin `react`, category correctness | [docs](https://oxc.rs/docs/guide/usage/linter/rules/react/exhaustive-deps.html) |
| Biome | `correctness/useExhaustiveDependencies` | yes | unsafe | group correctness, since 1.0.0 | [docs](https://biomejs.dev/linter/rules/use-exhaustive-dependencies/) |

## Code examples

### Incorrect: the rule reports this

```js
useEffect(() => {
  console.log(count);
}, []); // Missing 'count'
```

```js
useEffect(() => {
  fetchUser(userId);
}, []); // Missing 'userId'
```

```js
useMemo(() => {
  return items.sort(sortOrder);
}, [items]); // Missing 'sortOrder'
```

### Correct: the rule accepts this

```js
useEffect(() => {
  console.log(count);
}, [count]);
```

```js
useEffect(() => {
  fetchUser(userId);
}, [userId]);
```

```js
const logItems = () => {
  console.log(items);
};

return <button onClick={logItems}>Log</button>;
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import reactHooks from "eslint-plugin-react-hooks";

export default [
  {
    plugins: { "react-hooks": reactHooks },
    rules: {
      "react-hooks/exhaustive-deps": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "react"
  ],
  "rules": {
    "react/exhaustive-deps": "error"
  }
}
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "correctness": {
        "useExhaustiveDependencies": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [React Hooks recommended](https://lintradar.dev/presets/react-hooks-recommended.md) | ESLint | `eslint-plugin-react-hooks` | 16 | 118.4M | +21.5% |
| [Next.js Core Web Vitals](https://lintradar.dev/presets/next-core-web-vitals.md) | ESLint | `eslint-config-next` | 62 | 46.8M | +48.8% |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Create React App](https://lintradar.dev/presets/react-app.md) | ESLint | `eslint-config-react-app` | 109 | 4.1M | +4.3% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |
| [React Native](https://lintradar.dev/presets/react-native.md) | ESLint | `@react-native/eslint-config` | 79 | 1.2M | +5.8% |

## Related rules

- [react-hooks/rules-of-hooks](https://lintradar.dev/rules/react-hooks/rules-of-hooks.md): Enforces the Rules of Hooks
- [react-hooks/error-boundaries](https://lintradar.dev/rules/react-hooks/error-boundaries.md): Validates usage of error boundaries instead of try/catch for errors in child components
- [react-hooks/globals](https://lintradar.dev/rules/react-hooks/globals.md): Validates against assignment/mutation of globals during render, part of ensuring that side effects must render outside of render
- [react-hooks/immutability](https://lintradar.dev/rules/react-hooks/immutability.md): Validates against mutating props, state, and other values that are immutable
- [react-hooks/incompatible-library](https://lintradar.dev/rules/react-hooks/incompatible-library.md): Validates against usage of libraries which are incompatible with memoization (manual or automatic)
- [react-hooks/preserve-manual-memoization](https://lintradar.dev/rules/react-hooks/preserve-manual-memoization.md): Validates that existing manual memoized is preserved by the compiler. React Compiler will only compile components and hooks if its inference matches or exceeds the existing manual memoization

---

Web page: https://lintradar.dev/rules/react-hooks/exhaustive-deps. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
