diff --git a/package.json b/package.json index ba858b28..6002b28f 100644 --- a/package.json +++ b/package.json @@ -76,8 +76,8 @@ "@types/node": "^20.10.4", "@types/semver": "^7.5.6", "@typescript-eslint/eslint-plugin": "^6.14.0", - "@typescript-eslint/parser": "~6.10.0", - "@typescript-eslint/types": "~6.10.0", + "@typescript-eslint/parser": "~6.21.0", + "@typescript-eslint/types": "~6.21.0", "benchmark": "^2.1.4", "chai": "^4.3.10", "env-cmd": "^10.1.0", diff --git a/tests/src/parser/test-utils.ts b/tests/src/parser/test-utils.ts index 04d11770..b71248e8 100644 --- a/tests/src/parser/test-utils.ts +++ b/tests/src/parser/test-utils.ts @@ -578,6 +578,17 @@ function nodeReplacer(key: string, value: any): any { } } } + if ( + typeof obj.type === "string" && + (obj.type.startsWith("Import") || obj.type.startsWith("Export")) && + Array.isArray(obj.attributes) && + obj.attributes.length === 0 + ) { + // Node types changed in typescript-eslint v6. + const copy = { ...obj }; + delete copy.attributes; + obj = copy; + } } return normalizeObject(obj); }