File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments