eslint-plugin-hooks
TypeScript icon, indicating that this package has built-in type declarations

0.4.3 • Public • Published

eslint-plugin-hooks

Build GitHub stars GitHub forks GitHub issues GitHub license NPM

A simple organizer for ordering hooks.

Built with ❤︎ by hiukky


Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-hooks:

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

Usage

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

{
  "plugins": ["hooks"]
}

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

{
  "rules": {
    "hooks/sort": [
      2,
      {
        "groups": [
          "useReducer",
          "useContext",
          "useState",
          "useRef",
          "useDispatch",
          "useCallback",
          "useEffect"
        ]
      }
    ]
  }
}

Package Sidebar

Install

npm i eslint-plugin-hooks

Weekly Downloads

4,565

Version

0.4.3

License

MIT

Unpacked Size

13.9 kB

Total Files

11

Last publish

Collaborators

  • hiukky