eslint-plugin-react-hooks-order
v0.1.2
Published
React hooks sort order
Downloads
52
Maintainers
Readme
It is a fork from https://github.com/hiukky/eslint-plugin-hooks
Installation
$ npm i eslint eslint-plugin-react-hooks-order --save-dev
Usage
Add hooks
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": ["react-hooks-order"]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"hooks/sort": [
2,
{
"groups": [
"useReducer",
"useContext",
"useState",
"useRef",
"useDispatch",
"useCallback",
"useEffect"
]
}
]
}
}