1.0.7 • Published 1 year ago

eslint-plugin-require-useeffect-dependency-array v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

DEPRECATED

DEPRECATED: Use the @arabasta/eslint-plugin-require-useeffect-dependency-array package instead. See

eslint-plugin-require-useeffect-dependency-array

npm Github License

This ESLint plugin enforces that React useEffect has a dependency array.

Installation

Assuming you already have ESLint installed, run:

# npm
npm install eslint-plugin-require-useeffect-dependency-array --save-dev

# yarn
yarn add eslint-plugin-require-useeffect-dependency-array --dev

Then extend the recommended eslint config:

{
  "extends": [
    // ...
    "plugin:require-useeffect-dependency-array/recommended"
  ]
}

Rules

āœ… Set in the recommended configuration\ šŸ”§ Automatically fixable by the --fix CLI option

RuleDescriptionāœ…šŸ”§
require-useeffect-dependency-arrayEnforce that useEffect has a dependency arrayāœ…šŸ”§

require-useeffect-dependency-array

Examples of incorrect code for this rule:

useEffect(() => {})

Examples of correct code for this rule:

useEffect(() => {}, [])

License

MIT