Skip to content

Commit

Permalink
Update packages/eslint-plugin/src/rules/no-this-alias.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Josh Goldberg <me@joshuakgoldberg.com>
  • Loading branch information
juank1809 and JoshuaKGoldberg committed Mar 26, 2022
1 parent 874037a commit 84cef31
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions packages/eslint-plugin/src/rules/no-this-alias.ts
Expand Up @@ -51,13 +51,8 @@ export default util.createRule<Options, MessageIds>({
"VariableDeclarator[init.type='ThisExpression'], AssignmentExpression[right.type='ThisExpression']"(
node: TSESTree.VariableDeclarator | TSESTree.AssignmentExpression,
): void {
let id;

if (node.type === AST_NODE_TYPES.VariableDeclarator) {
id = node.id;
} else {
id = node.left;
}
const id =
node.type === AST_NODE_TYPES.VariableDeclarator ? node.id : node.left;
if (allowDestructuring && id.type !== AST_NODE_TYPES.Identifier) {
return;
}
Expand Down

0 comments on commit 84cef31

Please sign in to comment.