🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

eslint-plugin-react-hooks-docs

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-react-hooks-docs

Eslint plugin to enforce react hooks documentation

0.0.4
latest
Source
npm
Version published
Weekly downloads
134
17.54%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-plugin-react-hooks-docs

🚨 Eslint plugin to enforce react hooks documentation.


Follow @ahmad_tokyo

Installation

npm i eslint eslint-plugin-react-hooks-docs --save-dev

OR

yarn add -D eslint eslint-plugin-react-hooks-docs

Usage

You can extend the recommended configuration by adding 'plugin:eslint-plugin-react-hooks-docs/recommended' to the extends array in your eslintrc.

extends: ['plugin:eslint-plugin-react-hooks-docs/recommended'],

Manually applying the rules

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

{
  "plugins": ["react-hooks-docs"]
}

Then configure the rules you want to use under the rules section. Note that the 2nd param is optional extra configurations.

{
  "rules": {
    "react-hooks-docs/docs": [
      2,
      {
        "skipDeclarations": true,
        "skipHooks": []
      }
    ]
  }
}

Rules

docs

Enforces documentation to exist in the form of a comment for react hooks calls.

Options:

  • skipDeclarations: boolean - doesn't enforce the rule on hook declarations eg: const [state, setState] = useState(0);.
  • skipHooks: Array - doesn't enforce the rule on the hooks passed to in this array eg: useCustomHook

Built with ❤︎ by Ahmed Tokyo

Keywords

eslint

FAQs

Package last updated on 11 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts