0.1.1 • Published 3 years ago

eslint-plugin-hooks-sort v0.1.1

Weekly downloads
254
License
MIT
Repository
github
Last release
3 years ago

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-hooks-sort:

$ npm install eslint-plugin-hooks-sort --save-dev

Usage

Add hooks-sort to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": ["hooks-sort"]
}

Then configure the rules you want to use under the rules section.

{
  "rules": {
    "hooks-sort/order": [
      2,
      {
        "groups": [
          "useSelector",
          "useContext",
          "useState",
          "useDispatch",
          "useCallback"
        ]
      }
    ]
  }
}