Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

CloudNStoyan/eslint-plugin-require-useeffect-dependency-array

Repository files navigation

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

Rule Description 🔧
require-useeffect-dependency-array Enforce 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

About

ESLint rule for React useEffect

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published