Skip to content

Commit 2117624

Browse files
committed
Catch setState in cDU and cDM when defined as ClassProperties
1 parent b8105e1 commit 2117624

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/util/makeNoMethodSetStateRule.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function makeNoMethodSetStateRule(methodName) {
4747
depth++;
4848
}
4949
if (
50-
(ancestors[i].type !== 'Property' && ancestors[i].type !== 'MethodDefinition') ||
50+
(ancestors[i].type !== 'Property' && ancestors[i].type !== 'MethodDefinition' && ancestors[i].type !== 'ClassProperty') ||
5151
ancestors[i].key.name !== methodName ||
5252
(mode !== 'disallow-in-func' && depth > 1)
5353
) {

0 commit comments

Comments
 (0)