Skip to content

Commit d709abf

Browse files
authored
Chore: fix comment location in no-unused-vars (#14648)
1 parent e44ce0a commit d709abf

1 file changed

Lines changed: 15 additions & 9 deletions

File tree

lib/rules/no-unused-vars.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -449,18 +449,24 @@ module.exports = {
449449
return ref.isRead() && (
450450

451451
// self update. e.g. `a += 1`, `a++`
452-
(// in RHS of an assignment for itself. e.g. `a = a + 1`
453-
((
452+
(
453+
(
454454
parent.type === "AssignmentExpression" &&
455-
isUnusedExpression(parent) &&
456-
parent.left === id
455+
parent.left === id &&
456+
isUnusedExpression(parent)
457457
) ||
458+
(
459+
parent.type === "UpdateExpression" &&
460+
isUnusedExpression(parent)
461+
)
462+
) ||
463+
464+
// in RHS of an assignment for itself. e.g. `a = a + 1`
458465
(
459-
parent.type === "UpdateExpression" &&
460-
isUnusedExpression(parent)
461-
) || rhsNode &&
462-
isInside(id, rhsNode) &&
463-
!isInsideOfStorableFunction(id, rhsNode)))
466+
rhsNode &&
467+
isInside(id, rhsNode) &&
468+
!isInsideOfStorableFunction(id, rhsNode)
469+
)
464470
);
465471
}
466472

0 commit comments

Comments
 (0)