Skip to content

Commit 3bc35b3

Browse files
committed
[Refactor] no-*-set-state: improve performance
1 parent 96b3b06 commit 3bc35b3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/util/makeNoMethodSetStateRule.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,16 @@ module.exports = function makeNoMethodSetStateRule(methodName, shouldCheckUnsafe
7373
return false;
7474
}
7575

76+
if (shouldBeNoop(context, methodName)) {
77+
return {};
78+
}
79+
7680
// --------------------------------------------------------------------------
7781
// Public
7882
// --------------------------------------------------------------------------
7983

8084
return {
8185
CallExpression(node) {
82-
if (shouldBeNoop(context, methodName)) {
83-
return;
84-
}
85-
8686
const callee = node.callee;
8787
if (
8888
callee.type !== 'MemberExpression'

0 commit comments

Comments
 (0)