JSPM

eslint-plugin-react-hooks-extra

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 465656
  • Score
    100M100P100Q188347F
  • License ISC

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-plugin-react-hooks-extra) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    eslint-plugin-react-hooks-extra

    Extra rules for React Hooks.

    Install

    # npm
    npm install --save-dev eslint-plugin-react-hooks-extra

    Setup

    // eslint.config.js
    
    // @ts-check
    import js from "@eslint/js";
    import reactHooksExtra from "eslint-plugin-react-hooks-extra";
    import tseslint from "typescript-eslint";
    
    export default tseslint.config({
      files: ["**/*.ts", "**/*.tsx"],
      extends: [
        js.configs.recommended,
        tseslint.configs.recommended,
        reactHooksExtra.configs.recommended,
      ],
      languageOptions: {
        parser: tseslint.parser,
        parserOptions: {
          projectService: true,
          tsconfigRootDir: import.meta.dirname,
        },
      },
      rules: {
        // Put rules you want to override here
        "react-hooks-extra/no-unnecessary-use-prefix": "warn",
        "react-hooks-extra/prefer-use-state-lazy-initialization": "warn",
      },
    });

    Rules

    https://eslint-react.xyz/docs/rules/overview#hooks-extra-rules