eslint-plugin-no-undefined-initial-usestate
v1.0.2
Published
An eslint rule to warn against using undefined as an initial value when using the useState React hook
Downloads
3
Maintainers
Readme
eslint-plugin-no-undefined-initial-usestate
example of what this lints
const [state, useState] = useState()
const [state, useState] = useState(undefined)
install
yarn add eslint-plugin-no-undefined-initial-usestate -D
npm i eslint-plugin-no-undefined-initial-usestate --save-dev
eslint config
"plugins": ["no-undefined-initial-usestate"]
"rules": {
"no-undefined-initial-usestate/no-undefined-initial-usestate": "warn",