Skip to content

Commit 86ebf76

Browse files
authored
Update test-utils.ts
1 parent 5f92efe commit 86ebf76

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/src/parser/test-utils.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,17 @@ function nodeReplacer(key: string, value: any): any {
578578
}
579579
}
580580
}
581+
if (
582+
typeof obj.type === "string" &&
583+
(obj.type.startsWith("Import") || obj.type.startsWith("Export")) &&
584+
Array.isArray(obj.attributes) &&
585+
obj.attributes.length === 0
586+
) {
587+
// Node types changed in typescript-eslint v6.
588+
const copy = { ...obj };
589+
delete copy.attributes;
590+
obj = copy;
591+
}
581592
}
582593
return normalizeObject(obj);
583594
}

0 commit comments

Comments
 (0)