eslint-plugin-react-hooks-order

React hooks sort order

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
eslint-plugin-react-hooks-order
200.1.24 months ago4 months agoMinified + gzip package size for eslint-plugin-react-hooks-order in KB

Readme

eslint-plugin-react-hooks-order

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