Skip to content

Commit 8608146

Browse files
committed
fix logic in mark modified
1 parent 7cfe59d commit 8608146

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

plugins/rules/memberAccess.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,16 @@ const noRepeatedMemberAccess = createRule({
9999
markChainAsModified(properties: string[]): void {
100100
let current = this.root;
101101

102-
// Navigate to the target node
102+
// Navigate to the target node, creating nodes if they don't exist
103103
for (const prop of properties) {
104104
const child = current.children.get(prop);
105105
if (child) {
106106
current = child;
107107
} else {
108108
// Create the chain if it doesn't exist
109-
current = current.getOrCreateChild(prop);
110-
current.parent = current;
111-
current.modified = true;
109+
const newChild = current.getOrCreateChild(prop);
110+
newChild.parent = current;
111+
current = newChild;
112112
}
113113
}
114114

0 commit comments

Comments
 (0)