Skip to content

Commit

Permalink
[Fix] no-unused-state: false negative on using state of non-lifecycle
Browse files Browse the repository at this point in the history
  • Loading branch information
golopot committed May 12, 2019
1 parent a1b8888 commit c6cb33d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/no-unused-state.js
Expand Up @@ -101,7 +101,7 @@ module.exports = {
parent &&
parent.type === 'MethodDefinition' && (
parent.static && parent.key.name === 'getDerivedStateFromProps' ||
classMethods.indexOf(parent.key.name !== -1)
classMethods.indexOf(parent.key.name) !== -1
) &&
parent.value.type === 'FunctionExpression' &&
parent.value.params[1] &&
Expand Down

0 comments on commit c6cb33d

Please sign in to comment.