Skip to content

Commit c6cb33d

Browse files
committed
[Fix] no-unused-state: false negative on using state of non-lifecycle
1 parent a1b8888 commit c6cb33d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rules/no-unused-state.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ module.exports = {
101101
parent &&
102102
parent.type === 'MethodDefinition' && (
103103
parent.static && parent.key.name === 'getDerivedStateFromProps' ||
104-
classMethods.indexOf(parent.key.name !== -1)
104+
classMethods.indexOf(parent.key.name) !== -1
105105
) &&
106106
parent.value.type === 'FunctionExpression' &&
107107
parent.value.params[1] &&

0 commit comments

Comments
 (0)