0.0.2 • Published 2 years ago
eslint-plugin-react-strict-hooks v0.0.2
eslint-plugin-react-strict-hooks
Plugin for enforcing stricter rules on react hooks
Installation
You'll first need to install ESLint:
npm i eslint --save-dev
Next, install eslint-plugin-react-strict-hooks
:
npm install eslint-plugin-react-strict-hooks --save-dev
Usage
Add react-strict-hooks
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"react-strict-hooks"
]
}
Make sure that type checking in eslint is enabled
{
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname
}
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"react-strict-hooks/rule-name": 2
}
}
Rules
Name |
---|
no-useeffect-misuse |