npm.io
1.0.0 • Published 7 years ago

eslint-plugin-react-hooks-breadhead

Licence
MIT
Version
1.0.0
Deps
0
Size
51 kB
Vulns
0
Weekly
0
Stars
2

eslint-plugin-react-hooks-breadhead

What is this

This is a fork of eslint-plugin-react-hooks which allows omitting dispatch in dependencies array in hooks

Example


function Foo(props) {
  const dispatch = useThunk();
  useEffect(() => {
    console.log(dispatch);
  }, []); // <-- should not error
}

function Foo(props) {
  const test = {}
  useEffect(() => {
    console.log(test);
  }, []); // <-- should error
}

Installation


yarn add eslint-plugin-react-hooks-breadhead --dev

Usage


{
  "plugins": [
    "react-hooks-breadhead"
  ],
  "rules": {
    "react-hooks-breadhead/exhaustive-deps": "error"
  }
}