
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
@seiyab/eslint-plugin-react-hooks
Advanced tools
@seiyab/eslint-plugin-react-hooks
This is alternative to eslint-plugin-react-hooks because of https://github.com/facebook/react/issues/16265
Assuming you already have ESLint installed, run:
# npm
npm install @seiyab/eslint-plugin-react-hooks --save-dev
# yarn
yarn add @seiyab/eslint-plugin-react-hooks --dev
Then extend the recommended eslint config:
{
"extends": [
// ...
"plugin:@seiyab/react-hooks/recommended"
]
}
If you want more fine-grained configuration, you can instead add a snippet like this to your ESLint configuration file:
{
"plugins": [
// ...
"@seiyab/eslint-plugin-react-hooks"
],
"rules": {
// ...
"@seiyab/react-hooks/rules-of-hooks": "error",
"@seiyab/react-hooks/exhaustive-deps": "warn"
}
}
exhaustive-deps
can be configured to validate dependencies of custom Hooks with the additionalHooks
option.
This option accepts a regex to match the names of custom Hooks that have dependencies.
{
"rules": {
// ...
"@seiyab/react-hooks/exhaustive-deps": ["warn", {
"additionalHooks": "(useMyCustomHook|useMyOtherCustomHook)"
}]
}
}
We suggest to use this option very sparingly, if at all. Generally saying, we recommend most custom Hooks to not use the dependencies argument, and instead provide a higher-level API that is more focused around a specific use case.
You may find exhaustive-deps
requires entire props
if you use something like props.doSomething()
in hooks.
This is intended behavior because props
is referred as this
by doSomething
.
You can resolve it by destructuring as exhaustive-deps
suggests.
However, in some cases, you may want to avoid destructuring because of your coding style or conflict with no-shadow
.
In the case, ignoreThisDependency
may help.
{
"rules": {
// ...
"@seiyab/react-hooks/exhaustive-deps": ["warn", {
"ignoreThisDependency": "props"
}]
}
}
Valid options are never
(default behavior), props
, always
.
Please refer to the Rules of Hooks documentation and the Hooks FAQ to learn more about this rule.
MIT
FAQs
ESLint rules for React Hooks
The npm package @seiyab/eslint-plugin-react-hooks receives a total of 2,216 weekly downloads. As such, @seiyab/eslint-plugin-react-hooks popularity was classified as popular.
We found that @seiyab/eslint-plugin-react-hooks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.