0.1.2 • Published 2 years ago

eslint-plugin-react-hooks-order v0.1.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

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"
        ]
      }
    ]
  }
}