We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fee8c36 commit e779b00Copy full SHA for e779b00
lib/util/Components.js
@@ -458,10 +458,7 @@ function componentRule(rule, context) {
458
const node = scope.block;
459
const isFunction = /Function/.test(node.type); // Functions
460
const isArrowFunction = astUtil.isArrowFunction(node);
461
- let enclosingScope = scope;
462
- if (isArrowFunction) {
463
- enclosingScope = utils.getArrowFunctionScope(scope);
464
- }
+ const enclosingScope = isArrowFunction ? utils.getArrowFunctionScope(scope) : scope;
465
const enclosingScopeParent = enclosingScope && enclosingScope.block.parent;
466
const isClass = enclosingScope && astUtil.isClass(enclosingScope.block);
467
const isMethod = enclosingScopeParent && enclosingScopeParent.type === 'MethodDefinition'; // Classes methods
0 commit comments