Skip to content

Commit

Permalink
Document additionalHooks option
Browse files Browse the repository at this point in the history
  • Loading branch information
airjp73 authored Sep 26, 2019
1 parent fad5102 commit acaa56b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/eslint-plugin-react-hooks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@ Then add it to your ESLint configuration:
}
```

## Configuration

`exhaustive-deps` can be configured to validate custom hooks via the `additionalHooks` option.
This option accepts a regex to match the names of custom hooks.

```js
{
"rules": {
// ...
"react-hooks/exhaustive-deps": ["warn", { "additionalHooks": "(useMyCustomHook|useMyOtherCustomHook)" }]
}
}
```

## Valid and Invalid Examples

Please refer to the [Rules of Hooks](https://reactjs.org/docs/hooks-rules.html) documentation and the [Hooks FAQ](https://reactjs.org/docs/hooks-faq.html#what-exactly-do-the-lint-rules-enforce) to learn more about this rule.
Expand Down

0 comments on commit acaa56b

Please sign in to comment.