From b6c40b42b68d5567c7468030ee45b9b84bec4c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josh=20Goldberg=20=E2=9C=A8?= Date: Mon, 13 Nov 2023 08:27:23 -0500 Subject: [PATCH] feat: allow typescript@5.3.0-RC as devDependency (#7821) * feat: allow typescript@5.3.0-beta as devDependency * fix: no-restricted-imports.ts satisfies and assertions/attributes * Use patch-package for api-extractor * Review feedback on typos * Update patch with optional chaining * I, ah, forgot we're on Yarn 3+ * Fix lint, and update snapshots * typescript@5.3.1-rc, and aliased interfaces * add yarn.lock update as well * Went back to 5.3.0-beta --- ...-api-extractor-npm-7.38.0-955f1e0725.patch | 46 +++++++ ...ypescript-npm-5.3.0-beta-33b1e90865.patch} | 16 +-- package.json | 5 +- packages/ast-spec/package.json | 2 +- .../assertion/snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../kind-type/snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../named/snapshots/1-TSESTree-AST.shot | 2 +- .../named/snapshots/5-AST-Alignment-AST.shot | 3 +- .../type-kind/snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../unnamed/snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 40 +++++- .../declaration/ExportAllDeclaration/spec.ts | 8 ++ .../aliased/snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../class/snapshots/1-TSESTree-AST.shot | 2 +- .../class/snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../enum/snapshots/1-TSESTree-AST.shot | 2 +- .../enum/snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../interface/snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../namespace/snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../type-alias/snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../ExportNamedDeclaration/spec.ts | 37 +++++- .../assertion/snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../default/snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../named-many/snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../named-none/snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 40 +++++- .../named-one/snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../side-effect/snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 40 +++++- .../src/declaration/ImportDeclaration/spec.ts | 8 ++ .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 17 +-- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 21 +-- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 21 +-- .../declaration/VariableDeclaration/spec.ts | 4 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 15 ++- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 15 ++- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../export-type/snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 6 +- .../snapshots/5-AST-Alignment-AST.shot | 9 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 2 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 2 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 3 +- .../snapshots/1-TSESTree-AST.shot | 2 +- .../snapshots/5-AST-Alignment-AST.shot | 7 +- .../snapshots/1-TSESTree-AST.shot | 8 +- .../snapshots/5-AST-Alignment-AST.shot | 12 +- .../tests/fixtures-with-differences-ast.shot | 3 + .../src/rules/consistent-type-imports.ts | 4 +- .../src/rules/no-restricted-imports.ts | 1 + packages/scope-manager/src/lib/es5.ts | 1 + packages/typescript-estree/src/convert.ts | 125 ++++++++++++------ .../create-program/createIsolatedProgram.ts | 1 + .../create-program/createProjectService.ts | 1 + .../src/ts-estree/estree-to-ts-node-types.ts | 6 +- .../src/ts-estree/ts-nodes.ts | 18 ++- .../src/useProgramFromProjectService.ts | 3 +- .../lib/__snapshots__/convert.test.ts.snap | 2 +- .../__snapshots__/semanticInfo.test.ts.snap | 2 +- yarn.lock | 52 +++++--- 145 files changed, 605 insertions(+), 262 deletions(-) create mode 100644 .yarn/patches/@microsoft-api-extractor-npm-7.38.0-955f1e0725.patch rename .yarn/patches/{typescript-npm-5.2.2-01717e9f84.patch => typescript-npm-5.3.0-beta-33b1e90865.patch} (91%) diff --git a/.yarn/patches/@microsoft-api-extractor-npm-7.38.0-955f1e0725.patch b/.yarn/patches/@microsoft-api-extractor-npm-7.38.0-955f1e0725.patch new file mode 100644 index 00000000000..4a88d8663c3 --- /dev/null +++ b/.yarn/patches/@microsoft-api-extractor-npm-7.38.0-955f1e0725.patch @@ -0,0 +1,46 @@ +diff --git a/lib/analyzer/ExportAnalyzer.js b/lib/analyzer/ExportAnalyzer.js +index 51f31b4f2f253d82adc9594faa58d8dc031957e0..1fddac54b08665f5a5a717fef740613ae921cb7a 100644 +--- a/lib/analyzer/ExportAnalyzer.js ++++ b/lib/analyzer/ExportAnalyzer.js +@@ -193,7 +193,7 @@ class ExportAnalyzer { + const mode = specifier && ts.isStringLiteralLike(specifier) + ? TypeScriptInternals_1.TypeScriptInternals.getModeForUsageLocation(importOrExportDeclaration.getSourceFile(), specifier) + : undefined; +- const resolvedModule = TypeScriptInternals_1.TypeScriptInternals.getResolvedModule(importOrExportDeclaration.getSourceFile(), moduleSpecifier, mode); ++ const resolvedModule = TypeScriptInternals_1.TypeScriptInternals.getResolvedModule(this._program, importOrExportDeclaration.getSourceFile(), moduleSpecifier, mode); + if (resolvedModule === undefined) { + // The TS compiler API `getResolvedModule` cannot resolve ambient modules. Thus, to match API Extractor's + // previous behavior, simply treat all ambient modules as external. This bug is tracked by +@@ -666,7 +666,7 @@ class ExportAnalyzer { + ts.isStringLiteralLike(importOrExportDeclaration.moduleSpecifier) + ? TypeScriptInternals_1.TypeScriptInternals.getModeForUsageLocation(importOrExportDeclaration.getSourceFile(), importOrExportDeclaration.moduleSpecifier) + : undefined; +- const resolvedModule = TypeScriptInternals_1.TypeScriptInternals.getResolvedModule(importOrExportDeclaration.getSourceFile(), moduleSpecifier, mode); ++ const resolvedModule = TypeScriptInternals_1.TypeScriptInternals.getResolvedModule(this._program, importOrExportDeclaration.getSourceFile(), moduleSpecifier, mode); + if (resolvedModule === undefined) { + // Encountered in https://github.com/microsoft/rushstack/issues/1914. + // +diff --git a/lib/analyzer/TypeScriptInternals.js b/lib/analyzer/TypeScriptInternals.js +index ff13db7709ccf502fe202337869d4024431636c9..217c36b0303c3bf9871edabcd48fbf6e09f18561 100644 +--- a/lib/analyzer/TypeScriptInternals.js ++++ b/lib/analyzer/TypeScriptInternals.js +@@ -84,10 +84,16 @@ class TypeScriptInternals { + * Retrieves the (cached) module resolution information for a module name that was exported from a SourceFile. + * The compiler populates this cache as part of analyzing the source file. + */ +- static getResolvedModule(sourceFile, moduleNameText, mode) { ++ static getResolvedModule(program, sourceFile, moduleNameText, mode) { + // Compiler internal: +- // https://github.com/microsoft/TypeScript/blob/v4.7.2/src/compiler/utilities.ts#L161 +- return ts.getResolvedModule(sourceFile, moduleNameText, mode); ++ // https://github.com/microsoft/TypeScript/blob/v5.3-beta/src/compiler/types.ts#L4678 ++ const result = program.getResolvedModule( ++ sourceFile, ++ moduleNameText, ++ mode ++ ); ++ return result?.resolvedModule; ++ + } + /** + * Gets the mode required for module resolution required with the addition of Node16/nodenext diff --git a/.yarn/patches/typescript-npm-5.2.2-01717e9f84.patch b/.yarn/patches/typescript-npm-5.3.0-beta-33b1e90865.patch similarity index 91% rename from .yarn/patches/typescript-npm-5.2.2-01717e9f84.patch rename to .yarn/patches/typescript-npm-5.3.0-beta-33b1e90865.patch index 1dda4af6420..f4c3ff9cb1d 100644 --- a/.yarn/patches/typescript-npm-5.2.2-01717e9f84.patch +++ b/.yarn/patches/typescript-npm-5.3.0-beta-33b1e90865.patch @@ -1,8 +1,8 @@ diff --git a/lib/typescript.d.ts b/lib/typescript.d.ts -index ead6d07d8fb2af6aa74b790c9fd947f1062f6df4..f8dad7f06e74d7cfccfcd8fc9c5c7038a7fe4164 100644 +index d785077fd9e4eb5959c0badb857358fad09d4d3f..54f71344b098e8d46acd8dd77638c60d505bb996 100644 --- a/lib/typescript.d.ts +++ b/lib/typescript.d.ts -@@ -371,8 +371,8 @@ declare namespace ts { +@@ -4491,8 +4491,8 @@ declare namespace ts { JSDocFunctionType = 324, JSDocVariadicType = 325, JSDocNamepathType = 326, @@ -12,7 +12,7 @@ index ead6d07d8fb2af6aa74b790c9fd947f1062f6df4..f8dad7f06e74d7cfccfcd8fc9c5c7038 JSDocComment = 327, JSDocText = 328, JSDocTypeLiteral = 329, -@@ -738,6 +738,8 @@ declare namespace ts { +@@ -5066,6 +5066,8 @@ declare namespace ts { readonly name: PropertyName; readonly questionToken?: QuestionToken; readonly type?: TypeNode; @@ -21,7 +21,7 @@ index ead6d07d8fb2af6aa74b790c9fd947f1062f6df4..f8dad7f06e74d7cfccfcd8fc9c5c7038 } interface PropertyDeclaration extends ClassElement, JSDocContainer { readonly kind: SyntaxKind.PropertyDeclaration; -@@ -763,6 +765,10 @@ declare namespace ts { +@@ -5091,6 +5093,10 @@ declare namespace ts { readonly parent: ObjectLiteralExpression; readonly name: PropertyName; readonly initializer: Expression; @@ -32,7 +32,7 @@ index ead6d07d8fb2af6aa74b790c9fd947f1062f6df4..f8dad7f06e74d7cfccfcd8fc9c5c7038 } interface ShorthandPropertyAssignment extends ObjectLiteralElement, JSDocContainer { readonly kind: SyntaxKind.ShorthandPropertyAssignment; -@@ -770,6 +776,12 @@ declare namespace ts { +@@ -5098,6 +5104,12 @@ declare namespace ts { readonly name: Identifier; readonly equalsToken?: EqualsToken; readonly objectAssignmentInitializer?: Expression; @@ -45,7 +45,7 @@ index ead6d07d8fb2af6aa74b790c9fd947f1062f6df4..f8dad7f06e74d7cfccfcd8fc9c5c7038 } interface SpreadAssignment extends ObjectLiteralElement, JSDocContainer { readonly kind: SyntaxKind.SpreadAssignment; -@@ -892,6 +904,8 @@ declare namespace ts { +@@ -5222,6 +5234,8 @@ declare namespace ts { } interface FunctionTypeNode extends FunctionOrConstructorTypeNodeBase, LocalsContainer { readonly kind: SyntaxKind.FunctionType; @@ -54,7 +54,7 @@ index ead6d07d8fb2af6aa74b790c9fd947f1062f6df4..f8dad7f06e74d7cfccfcd8fc9c5c7038 } interface ConstructorTypeNode extends FunctionOrConstructorTypeNodeBase, LocalsContainer { readonly kind: SyntaxKind.ConstructorType; -@@ -4584,7 +4598,13 @@ declare namespace ts { +@@ -8978,7 +8992,13 @@ declare namespace ts { function symbolName(symbol: Symbol): string; function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | PrivateIdentifier | undefined; function getNameOfDeclaration(declaration: Declaration | Expression | undefined): DeclarationName | undefined; @@ -68,7 +68,7 @@ index ead6d07d8fb2af6aa74b790c9fd947f1062f6df4..f8dad7f06e74d7cfccfcd8fc9c5c7038 function getModifiers(node: HasModifiers): readonly Modifier[] | undefined; /** * Gets the JSDoc parameter tags for the node if present. -@@ -5110,7 +5130,13 @@ declare namespace ts { +@@ -9508,7 +9528,13 @@ declare namespace ts { function isModuleName(node: Node): node is ModuleName; function isBinaryOperatorToken(node: Node): node is BinaryOperatorToken; function setTextRange(range: T, location: TextRange | undefined): T; diff --git a/package.json b/package.json index c4d61e01491..ce6dcc97112 100644 --- a/package.json +++ b/package.json @@ -114,12 +114,13 @@ "ts-node": "10.7.0", "tslint": "^6.1.3", "tsx": "^3.12.7", - "typescript": ">=4.3.5 <5.3.0" + "typescript": ">=4.3.5 <5.4.0" }, "resolutions": { "@jest/create-cache-key-function": "^29", "@jest/reporters": "^29", "@jest/test-result": "^29", + "@microsoft/api-extractor@^7.38.0": "patch:@microsoft/api-extractor@npm%3A7.38.0#./.yarn/patches/@microsoft-api-extractor-npm-7.38.0-955f1e0725.patch", "@swc/core-android-arm-eabi": "link:./tools/dummypkg", "@swc/core-android-arm64": "link:./tools/dummypkg", "@swc/core-freebsd-x64": "link:./tools/dummypkg", @@ -140,7 +141,7 @@ "pretty-format": "^29", "react-split-pane@^0.1.92": "patch:react-split-pane@npm%3A0.1.92#./.yarn/patches/react-split-pane-npm-0.1.92-93dbf51dff.patch", "tsx": "^3.12.7", - "typescript": "patch:typescript@npm%3A5.2.2#./.yarn/patches/typescript-npm-5.2.2-01717e9f84.patch" + "typescript": "patch:typescript@npm%3A5.3.0-beta#./.yarn/patches/typescript-npm-5.3.0-beta-33b1e90865.patch" }, "packageManager": "yarn@3.6.4" } diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index cdab601c4b1..c99bb37a9c4 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -47,7 +47,7 @@ "@babel/core": "*", "@babel/eslint-parser": "*", "@babel/parser": "*", - "@microsoft/api-extractor": "^7.36.1", + "@microsoft/api-extractor": "^7.38.0", "glob": "*", "jest": "29.7.0", "jest-diff": "^29.6.2", diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/1-TSESTree-AST.shot index cfc3aa2ff7c..d4d3be0f79a 100644 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportAllDeclaration { type: "ExportAllDeclaration", - assertions: [ + attributes: [ ImportAttribute { type: "ImportAttribute", key: Identifier { diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/5-AST-Alignment-AST.shot index 73bad658c9a..9a60939d18a 100644 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures declaration ExportAllDeclaration assertion AST Alignment - body: Array [ ExportAllDeclaration { type: 'ExportAllDeclaration', - assertions: Array [ +- attributes: Array [ ++ assertions: Array [ ImportAttribute { type: 'ImportAttribute', key: Identifier { diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/kind-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/kind-type/snapshots/1-TSESTree-AST.shot index 4ca39e1413a..eb9e1688183 100644 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/kind-type/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/kind-type/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportAllDeclaration { type: "ExportAllDeclaration", - assertions: [], + attributes: [], exported: Identifier { type: "Identifier", decorators: [], diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/kind-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/kind-type/snapshots/5-AST-Alignment-AST.shot index 35ef7eeb190..dbcf1bf3b12 100644 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/kind-type/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/kind-type/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures declaration ExportAllDeclaration kind-type AST Alignment - body: Array [ ExportAllDeclaration { type: 'ExportAllDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], exported: Identifier { type: 'Identifier', - decorators: Array [], diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/1-TSESTree-AST.shot index 0e45eb9b9ff..84025787ab1 100644 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportAllDeclaration { type: "ExportAllDeclaration", - assertions: [], + attributes: [], exported: Identifier { type: "Identifier", decorators: [], diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/5-AST-Alignment-AST.shot index 195370c94fc..33aaeac3507 100644 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/named/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures declaration ExportAllDeclaration named AST Alignment - AST body: Array [ ExportAllDeclaration { type: 'ExportAllDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], exported: Identifier { type: 'Identifier', - decorators: Array [], diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/type-kind/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/type-kind/snapshots/1-TSESTree-AST.shot index f027390217e..007669444c1 100644 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/type-kind/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/type-kind/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportAllDeclaration { type: "ExportAllDeclaration", - assertions: [], + attributes: [], exported: null, exportKind: "type", source: Literal { diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/type-kind/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/type-kind/snapshots/5-AST-Alignment-AST.shot index 50686a54834..235265f72d9 100644 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/type-kind/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/type-kind/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures declaration ExportAllDeclaration type-kind AST Alignment - body: Array [ ExportAllDeclaration { type: 'ExportAllDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], exported: null, exportKind: 'type', source: Literal { diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/1-TSESTree-AST.shot index e7e2e4c8e24..c64ca9e8dd9 100644 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportAllDeclaration { type: "ExportAllDeclaration", - assertions: [], + attributes: [], exported: null, exportKind: "value", source: Literal { diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/5-AST-Alignment-AST.shot index 351bb72f34f..e9283193a2c 100644 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/unnamed/snapshots/5-AST-Alignment-AST.shot @@ -2,5 +2,43 @@ exports[`AST Fixtures declaration ExportAllDeclaration unnamed AST Alignment - AST 1`] = ` "Snapshot Diff: -Compared values have no visual difference." +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportAllDeclaration { + type: 'ExportAllDeclaration', +- attributes: Array [], ++ assertions: Array [], + exported: null, + exportKind: 'value', + source: Literal { + type: 'Literal', + raw: '\\'my-module\\'', + value: 'my-module', + + range: [14, 25], + loc: { + start: { column: 14, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + + range: [0, 26], + loc: { + start: { column: 0, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ], + sourceType: 'module', + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" `; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/spec.ts b/packages/ast-spec/src/declaration/ExportAllDeclaration/spec.ts index 168f7b40b61..550e8da2ec5 100644 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/spec.ts +++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/spec.ts @@ -12,8 +12,16 @@ export interface ExportAllDeclaration extends BaseNode { * ``` * export * from 'mod' assert { type: 'json' }; * ``` + * @deprecated -- Replaced with {@link `attributes`}. */ assertions: ImportAttribute[]; + /** + * The attributes declared for the export. + * ``` + * export * from 'mod' assert { type: 'json' }; + * ``` + */ + attributes: ImportAttribute[]; /** * The name for the exported items. `null` if no name is assigned. */ diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/1-TSESTree-AST.shot index 4b9ea6313a3..1b2d074fc6e 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: null, exportKind: "value", source: null, diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/5-AST-Alignment-AST.shot index 81487c9bfc1..1fd302c1143 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures declaration ExportNamedDeclaration aliased AST Alignment - body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: null, exportKind: 'value', source: null, diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/1-TSESTree-AST.shot index f5bf7d6c3a9..05582ecc396 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: ClassDeclaration { type: "ClassDeclaration", abstract: false, diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/5-AST-Alignment-AST.shot index 1e08010d64d..bff52ed5d3c 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/class/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures declaration ExportNamedDeclaration class AST Alignment - A body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: ClassDeclaration { type: 'ClassDeclaration', - abstract: false, diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/1-TSESTree-AST.shot index 47339e03ec4..68410719810 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: TSDeclareFunction { type: "TSDeclareFunction", async: false, diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/5-AST-Alignment-AST.shot index b1623c4968c..bf0e8adefb7 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures declaration ExportNamedDeclaration declare-function AST Al body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: TSDeclareFunction { type: 'TSDeclareFunction', async: false, diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/1-TSESTree-AST.shot index 8f25a46494f..f3dff0f70ee 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: TSEnumDeclaration { type: "TSEnumDeclaration", const: false, diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/5-AST-Alignment-AST.shot index cba00ad04c1..0f83a6c9f50 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/enum/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures declaration ExportNamedDeclaration enum AST Alignment - AS body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: TSEnumDeclaration { type: 'TSEnumDeclaration', - const: false, diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/1-TSESTree-AST.shot index ba60ee6c0a8..5624b4ea160 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: FunctionDeclaration { type: "FunctionDeclaration", async: false, diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/5-AST-Alignment-AST.shot index 31a4f289f30..1a351f58113 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures declaration ExportNamedDeclaration function-declaration AS body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: FunctionDeclaration { type: 'FunctionDeclaration', async: false, diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/1-TSESTree-AST.shot index 72b482685c1..d9f0a017774 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: null, exportKind: "value", source: null, diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/5-AST-Alignment-AST.shot index d17b88c8cc6..5336bc5c7c6 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures declaration ExportNamedDeclaration identifier-braced AST A body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: null, exportKind: 'value', source: null, diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/1-TSESTree-AST.shot index cf88a1a29c4..8892a61581c 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: null, exportKind: "value", source: null, diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/5-AST-Alignment-AST.shot index 19de4d0f7c2..00294e85963 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures declaration ExportNamedDeclaration identifier-many AST Ali body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: null, exportKind: 'value', source: null, diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/1-TSESTree-AST.shot index 490d6d7493d..b4d3be7eb87 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: TSInterfaceDeclaration { type: "TSInterfaceDeclaration", body: TSInterfaceBody { diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/5-AST-Alignment-AST.shot index 4a6ef4e90d4..2655b20df12 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/interface/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures declaration ExportNamedDeclaration interface AST Alignment body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: TSInterfaceDeclaration { type: 'TSInterfaceDeclaration', body: TSInterfaceBody { diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/1-TSESTree-AST.shot index 073273fe601..f5e926919ff 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: TSModuleDeclaration { type: "TSModuleDeclaration", body: TSModuleBlock { diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/5-AST-Alignment-AST.shot index f2293b94d19..b6e7fae5973 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures declaration ExportNamedDeclaration namespace AST Alignment body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: TSModuleDeclaration { type: 'TSModuleDeclaration', body: TSModuleBlock { diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/1-TSESTree-AST.shot index a5080b151db..b18cd2895fd 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: TSTypeAliasDeclaration { type: "TSTypeAliasDeclaration", declare: false, diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/5-AST-Alignment-AST.shot index 896628c6482..24c9430be9d 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/type-alias/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures declaration ExportNamedDeclaration type-alias AST Alignmen body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: TSTypeAliasDeclaration { type: 'TSTypeAliasDeclaration', - declare: false, diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/1-TSESTree-AST.shot index 92f70fe2850..17fb53820f5 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: VariableDeclaration { type: "VariableDeclaration", declarations: [ diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/5-AST-Alignment-AST.shot index b265b8c947b..1514cd42b5d 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/variable-declaration/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures declaration ExportNamedDeclaration variable-declaration AS body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: VariableDeclaration { type: 'VariableDeclaration', declarations: Array [ diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/spec.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/spec.ts index b9b158eddb4..c71ed8b07ae 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/spec.ts +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/spec.ts @@ -14,8 +14,17 @@ interface ExportNamedDeclarationBase extends BaseNode { * export { foo } from 'mod' assert { type: 'json' }; * ``` * This will be an empty array if `source` is `null` + * @deprecated Replaced with {@link `attributes`}. */ assertions: ImportAttribute[]; + /** + * The attributes declared for the export. + * ``` + * export { foo } from 'mod' assert { type: 'json' }; + * ``` + * This will be an empty array if `source` is `null` + */ + attributes: ImportAttribute[]; /** * The exported declaration. * ``` @@ -44,8 +53,15 @@ interface ExportNamedDeclarationBase extends BaseNode { export interface ExportNamedDeclarationWithoutSourceWithMultiple extends ExportNamedDeclarationBase { - // this will always be empty array + /** + * This will always be an empty array. + * @deprecated Replaced with {@link `attributes`}. + */ assertions: ImportAttribute[]; + /** + * This will always be an empty array. + */ + attributes: ImportAttribute[]; declaration: null; source: null; specifiers: ExportSpecifier[]; @@ -53,17 +69,32 @@ export interface ExportNamedDeclarationWithoutSourceWithMultiple export interface ExportNamedDeclarationWithoutSourceWithSingle extends ExportNamedDeclarationBase { - // this will always be empty array + /** + * This will always be an empty array. + * @deprecated Replaced with {@link `attributes`}. + */ assertions: ImportAttribute[]; + /** + * This will always be an empty array. + */ + attributes: ImportAttribute[]; declaration: NamedExportDeclarations; source: null; - // this will always be empty array + // This will always be an empty array. specifiers: ExportSpecifier[]; } export interface ExportNamedDeclarationWithSource extends ExportNamedDeclarationBase { + /** + * This will always be an empty array. + * @deprecated Replaced with {@link `attributes`}. + */ assertions: ImportAttribute[]; + /** + * This will always be an empty array. + */ + attributes: ImportAttribute[]; declaration: null; source: StringLiteral; specifiers: ExportSpecifier[]; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/assertion/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/assertion/snapshots/1-TSESTree-AST.shot index c4795890019..c112b9bf9ff 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/assertion/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/assertion/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ImportDeclaration { type: "ImportDeclaration", - assertions: [ + attributes: [ ImportAttribute { type: "ImportAttribute", key: Identifier { diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/assertion/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/assertion/snapshots/5-AST-Alignment-AST.shot index 96cbf1acd91..0d9ee4b2c0c 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/assertion/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/assertion/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures declaration ImportDeclaration assertion AST Alignment - AS body: Array [ ImportDeclaration { type: 'ImportDeclaration', - assertions: Array [ +- attributes: Array [ ++ assertions: Array [ ImportAttribute { type: 'ImportAttribute', key: Identifier { diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-many/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-many/snapshots/1-TSESTree-AST.shot index 8b38359c0e5..d8d73d809e3 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-many/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-many/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ImportDeclaration { type: "ImportDeclaration", - assertions: [], + attributes: [], importKind: "value", source: Literal { type: "Literal", diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-many/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-many/snapshots/5-AST-Alignment-AST.shot index c6194ed4271..81c23f7e0c9 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-many/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-many/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures declaration ImportDeclaration default-and-named-many AST A body: Array [ ImportDeclaration { type: 'ImportDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], importKind: 'value', source: Literal { type: 'Literal', diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-none/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-none/snapshots/1-TSESTree-AST.shot index bed5bd1289c..3283817bac2 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-none/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-none/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ImportDeclaration { type: "ImportDeclaration", - assertions: [], + attributes: [], importKind: "value", source: Literal { type: "Literal", diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-none/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-none/snapshots/5-AST-Alignment-AST.shot index 7d7acd1e28b..1bf08842615 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-none/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-none/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures declaration ImportDeclaration default-and-named-none AST A body: Array [ ImportDeclaration { type: 'ImportDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], importKind: 'value', source: Literal { type: 'Literal', diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-one/snapshots/1-TSESTree-AST.shot index f54adf1db18..d4b801ba1a5 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-one/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-one/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ImportDeclaration { type: "ImportDeclaration", - assertions: [], + attributes: [], importKind: "value", source: Literal { type: "Literal", diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-one/snapshots/5-AST-Alignment-AST.shot index 5457bc7111e..ed408e5d864 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-one/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-one/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures declaration ImportDeclaration default-and-named-one AST Al body: Array [ ImportDeclaration { type: 'ImportDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], importKind: 'value', source: Literal { type: 'Literal', diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-namespace/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-namespace/snapshots/1-TSESTree-AST.shot index ab716a4e00f..f4f243232bb 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-namespace/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-namespace/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ImportDeclaration { type: "ImportDeclaration", - assertions: [], + attributes: [], importKind: "value", source: Literal { type: "Literal", diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-namespace/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-namespace/snapshots/5-AST-Alignment-AST.shot index 622ac6c755b..81fe9c5df57 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-namespace/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-namespace/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures declaration ImportDeclaration default-and-namespace AST Al body: Array [ ImportDeclaration { type: 'ImportDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], importKind: 'value', source: Literal { type: 'Literal', diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default/snapshots/1-TSESTree-AST.shot index 50127e55882..0cd95609cb3 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ImportDeclaration { type: "ImportDeclaration", - assertions: [], + attributes: [], importKind: "value", source: Literal { type: "Literal", diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default/snapshots/5-AST-Alignment-AST.shot index 4bbe4eb9480..1e180527e93 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures declaration ImportDeclaration default AST Alignment - AST body: Array [ ImportDeclaration { type: 'ImportDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], importKind: 'value', source: Literal { type: 'Literal', diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-many/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-many/snapshots/1-TSESTree-AST.shot index 38a4b893dcc..c1c0e430a67 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-many/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-many/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ImportDeclaration { type: "ImportDeclaration", - assertions: [], + attributes: [], importKind: "value", source: Literal { type: "Literal", diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-many/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-many/snapshots/5-AST-Alignment-AST.shot index 43e85474199..ca6533d7e03 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-many/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-many/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures declaration ImportDeclaration named-many AST Alignment - A body: Array [ ImportDeclaration { type: 'ImportDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], importKind: 'value', source: Literal { type: 'Literal', diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-none/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-none/snapshots/1-TSESTree-AST.shot index bb80f4408ac..bfb4b8933ad 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-none/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-none/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ImportDeclaration { type: "ImportDeclaration", - assertions: [], + attributes: [], importKind: "value", source: Literal { type: "Literal", diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-none/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-none/snapshots/5-AST-Alignment-AST.shot index aa52a0d98d1..ae715084a6c 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-none/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-none/snapshots/5-AST-Alignment-AST.shot @@ -2,5 +2,43 @@ exports[`AST Fixtures declaration ImportDeclaration named-none AST Alignment - AST 1`] = ` "Snapshot Diff: -Compared values have no visual difference." +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ImportDeclaration { + type: 'ImportDeclaration', +- attributes: Array [], ++ assertions: Array [], + importKind: 'value', + source: Literal { + type: 'Literal', + raw: '\\'mod\\'', + value: 'mod', + + range: [15, 20], + loc: { + start: { column: 15, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + specifiers: Array [], + + range: [0, 21], + loc: { + start: { column: 0, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + ], + sourceType: 'module', + + range: [0, 22], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" `; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-one/snapshots/1-TSESTree-AST.shot index 1bf7774ca11..1e892187a4a 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-one/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-one/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ImportDeclaration { type: "ImportDeclaration", - assertions: [], + attributes: [], importKind: "value", source: Literal { type: "Literal", diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-one/snapshots/5-AST-Alignment-AST.shot index d9cd9c7eb25..2412206ff2a 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-one/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-one/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures declaration ImportDeclaration named-one AST Alignment - AS body: Array [ ImportDeclaration { type: 'ImportDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], importKind: 'value', source: Literal { type: 'Literal', diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/side-effect/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/side-effect/snapshots/1-TSESTree-AST.shot index 33f9a8b9175..ffe99921f25 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/side-effect/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/side-effect/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ImportDeclaration { type: "ImportDeclaration", - assertions: [], + attributes: [], importKind: "value", source: Literal { type: "Literal", diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/side-effect/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/side-effect/snapshots/5-AST-Alignment-AST.shot index 2fa96b2dc1c..8db8df89869 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/side-effect/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/side-effect/snapshots/5-AST-Alignment-AST.shot @@ -2,5 +2,43 @@ exports[`AST Fixtures declaration ImportDeclaration side-effect AST Alignment - AST 1`] = ` "Snapshot Diff: -Compared values have no visual difference." +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ImportDeclaration { + type: 'ImportDeclaration', +- attributes: Array [], ++ assertions: Array [], + importKind: 'value', + source: Literal { + type: 'Literal', + raw: '\\'mod\\'', + value: 'mod', + + range: [7, 12], + loc: { + start: { column: 7, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + specifiers: Array [], + + range: [0, 13], + loc: { + start: { column: 0, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + ], + sourceType: 'module', + + range: [0, 14], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" `; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/spec.ts b/packages/ast-spec/src/declaration/ImportDeclaration/spec.ts index 389af77f87a..a9d49a75d4c 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/spec.ts +++ b/packages/ast-spec/src/declaration/ImportDeclaration/spec.ts @@ -12,8 +12,16 @@ export interface ImportDeclaration extends BaseNode { * ``` * import * from 'mod' assert { type: 'json' }; * ``` + * @deprecated -- Replaced with {@link `attributes`}. */ assertions: ImportAttribute[]; + /** + * The attributes declared for the export. + * ``` + * import * from 'mod' with { type: 'json' }; + * ``` + */ + attributes: ImportAttribute[]; /** * The kind of the import. */ diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/1-TSESTree-AST.shot index d8b2ef582c9..908af8690a9 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: TSModuleDeclaration { type: "TSModuleDeclaration", body: TSModuleBlock { diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/5-AST-Alignment-AST.shot index 84f061a5ebd..12815a82d50 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/5-AST-Alignment-AST.shot @@ -10,13 +10,19 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-expo body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: TSModuleDeclaration { type: 'TSModuleDeclaration', - body: TSModuleBlock { - type: 'TSModuleBlock', - body: Array [], -- ++ body: TSModuleDeclaration { ++ type: 'TSModuleDeclaration', ++ body: TSModuleBlock { ++ type: 'TSModuleBlock', ++ body: Array [], + - range: [25, 27], - loc: { - start: { column: 25, line: 1 }, @@ -32,12 +38,7 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-expo - decorators: Array [], - name: 'abd', - optional: false, -+ body: TSModuleDeclaration { -+ type: 'TSModuleDeclaration', -+ body: TSModuleBlock { -+ type: 'TSModuleBlock', -+ body: Array [], - +- - range: [17, 20], + range: [25, 27], loc: { diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/1-TSESTree-AST.shot index d725dc2ec65..f8a545ccce4 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: TSModuleDeclaration { type: "TSModuleDeclaration", body: TSModuleBlock { diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/5-AST-Alignment-AST.shot index dc9a53f795d..ff8cdfd1b19 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/5-AST-Alignment-AST.shot @@ -10,13 +10,21 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-exp body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: TSModuleDeclaration { type: 'TSModuleDeclaration', - body: TSModuleBlock { - type: 'TSModuleBlock', - body: Array [], -- ++ body: TSModuleDeclaration { ++ type: 'TSModuleDeclaration', ++ body: TSModuleDeclaration { ++ type: 'TSModuleDeclaration', ++ body: TSModuleBlock { ++ type: 'TSModuleBlock', ++ body: Array [], + - range: [37, 39], - loc: { - start: { column: 37, line: 1 }, @@ -34,14 +42,7 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-exp - decorators: Array [], - name: 'abc', - optional: false, -+ body: TSModuleDeclaration { -+ type: 'TSModuleDeclaration', -+ body: TSModuleDeclaration { -+ type: 'TSModuleDeclaration', -+ body: TSModuleBlock { -+ type: 'TSModuleBlock', -+ body: Array [], - +- - range: [25, 28], + range: [37, 39], loc: { diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/1-TSESTree-AST.shot index 2446e9b9508..112dd814b91 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: TSModuleDeclaration { type: "TSModuleDeclaration", body: TSModuleBlock { diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/5-AST-Alignment-AST.shot index 26c9b139613..2f3bcf0ef68 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/5-AST-Alignment-AST.shot @@ -10,13 +10,21 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-exp body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: TSModuleDeclaration { type: 'TSModuleDeclaration', - body: TSModuleBlock { - type: 'TSModuleBlock', - body: Array [], -- ++ body: TSModuleDeclaration { ++ type: 'TSModuleDeclaration', ++ body: TSModuleDeclaration { ++ type: 'TSModuleDeclaration', ++ body: TSModuleBlock { ++ type: 'TSModuleBlock', ++ body: Array [], + - range: [29, 31], - loc: { - start: { column: 29, line: 1 }, @@ -34,14 +42,7 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-exp - decorators: Array [], - name: 'abc', - optional: false, -+ body: TSModuleDeclaration { -+ type: 'TSModuleDeclaration', -+ body: TSModuleDeclaration { -+ type: 'TSModuleDeclaration', -+ body: TSModuleBlock { -+ type: 'TSModuleBlock', -+ body: Array [], - +- - range: [17, 20], + range: [29, 31], loc: { diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/spec.ts b/packages/ast-spec/src/declaration/VariableDeclaration/spec.ts index 726af07ea09..23a04b68324 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/spec.ts +++ b/packages/ast-spec/src/declaration/VariableDeclaration/spec.ts @@ -36,7 +36,7 @@ export interface LetOrConstOrVarDeclaration extends BaseNode { kind: 'const' | 'let' | 'var'; } -export interface UsingInNomalConextDeclaration extends BaseNode { +export interface UsingInNormalContextDeclaration extends BaseNode { type: AST_NODE_TYPES.VariableDeclaration; /** * The variables declared by this declaration. @@ -91,6 +91,6 @@ export interface UsingInForOfDeclaration extends BaseNode { export type UsingDeclaration = | UsingInForOfDeclaration - | UsingInNomalConextDeclaration; + | UsingInNormalContextDeclaration; export type VariableDeclaration = LetOrConstOrVarDeclaration | UsingDeclaration; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/1-TSESTree-AST.shot index d9de87c19aa..6a7d0db18ea 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: ClassDeclaration { type: "ClassDeclaration", abstract: true, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/5-AST-Alignment-AST.shot index 0ab1de91b9e..84f4b685820 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-method body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: ClassDeclaration { type: 'ClassDeclaration', abstract: true, @@ -84,21 +85,21 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-method loc: { start: { column: 34, line: 4 }, end: { column: 42, line: 4 }, -- }, -- }, + }, + }, - typeName: Identifier { - type: 'Identifier', - decorators: Array [], - name: 'Promise', - optional: false, -- + - range: [139, 146], - loc: { - start: { column: 27, line: 4 }, - end: { column: 34, line: 4 }, - }, - }, - +- }, +- }, +- range: [139, 154], loc: { start: { column: 27, line: 4 }, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/1-TSESTree-AST.shot index 391e52d7197..751453c2353 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: ClassDeclaration { type: "ClassDeclaration", abstract: true, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/5-AST-Alignment-AST.shot index b706fb052fb..f53e867eede 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-optional-method body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: ClassDeclaration { type: 'ClassDeclaration', abstract: true, @@ -81,21 +82,21 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-optional-method loc: { start: { column: 26, line: 4 }, end: { column: 34, line: 4 }, - }, - }, +- }, +- }, - typeName: Identifier { - type: 'Identifier', - decorators: Array [], - name: 'Promise', - optional: false, - +- - range: [131, 138], - loc: { - start: { column: 19, line: 4 }, - end: { column: 26, line: 4 }, -- }, -- }, -- + }, + }, + range: [131, 146], loc: { start: { column: 19, line: 4 }, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/1-TSESTree-AST.shot index 370da199472..99ffa472f88 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportAllDeclaration { type: "ExportAllDeclaration", - assertions: [ + attributes: [ ImportAttribute { type: "ImportAttribute", key: Identifier { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/5-AST-Alignment-AST.shot index 58f3e3de323..a18ffe53a77 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics export-all-with-import-assertions A body: Array [ ExportAllDeclaration { type: 'ExportAllDeclaration', - assertions: Array [ +- attributes: Array [ ++ assertions: Array [ ImportAttribute { type: 'ImportAttribute', key: Identifier { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot index f1169f5926c..edf76ad24ae 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: TSEnumDeclaration { type: "TSEnumDeclaration", const: true, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot index b3b73fdb401..1795c330025 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics export-declare-const-named-enum AST body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: TSEnumDeclaration { type: 'TSEnumDeclaration', const: true, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot index 3b057de32f4..14b710bbca7 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: TSEnumDeclaration { type: "TSEnumDeclaration", const: false, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot index 2d768bbf61b..90b208e7ad1 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics export-declare-named-enum AST Align body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: TSEnumDeclaration { type: 'TSEnumDeclaration', - const: false, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/1-TSESTree-AST.shot index 937557783da..417f7527535 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: ClassDeclaration { type: "ClassDeclaration", abstract: false, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/5-AST-Alignment-AST.shot index cd249e319cc..503617607ae 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics export-named-class-with-generic AST body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: ClassDeclaration { type: 'ClassDeclaration', - abstract: false, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot index efc242f4dfd..d0229b3fda0 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: ClassDeclaration { type: "ClassDeclaration", abstract: false, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot index 122e2a3401f..46b3b24b50c 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics export-named-class-with-multiple-ge body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: ClassDeclaration { type: 'ClassDeclaration', - abstract: false, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot index cb3489f2b02..7126562753f 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: TSEnumDeclaration { type: "TSEnumDeclaration", const: false, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot index 1471fe30127..020aebc7f3d 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics export-named-enum AST Alignment - A body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: TSEnumDeclaration { type: 'TSEnumDeclaration', - const: false, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/1-TSESTree-AST.shot index 20335c1996f..7a216b2b6f8 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportAllDeclaration { type: "ExportAllDeclaration", - assertions: [], + attributes: [], exported: Identifier { type: "Identifier", decorators: [], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/5-AST-Alignment-AST.shot index e6b5545d6af..12c0722a78d 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics export-star-as-ns-from AST Alignmen body: Array [ ExportAllDeclaration { type: 'ExportAllDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], exported: Identifier { type: 'Identifier', - decorators: Array [], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/1-TSESTree-AST.shot index afa8b170882..0ba289175e4 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: null, exportKind: "type", source: null, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/5-AST-Alignment-AST.shot index c9dea6f3214..7804541d7ef 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics export-type-as AST Alignment - AST body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: null, exportKind: 'type', source: null, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/1-TSESTree-AST.shot index ddf7996e773..84051a627fd 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: null, exportKind: "type", source: Literal { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/5-AST-Alignment-AST.shot index 0192033c168..e15bd85ed1c 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics export-type-from-as AST Alignment - body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: null, exportKind: 'type', source: Literal { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/1-TSESTree-AST.shot index 4c12ca941c0..b6b36a784a7 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: null, exportKind: "type", source: Literal { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/5-AST-Alignment-AST.shot index 47d6b2af6f2..b6a224ee204 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics export-type-from AST Alignment - AS body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: null, exportKind: 'type', source: Literal { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-star-from/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-star-from/snapshots/1-TSESTree-AST.shot index 62fbec4b35e..f0bf16edebd 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-star-from/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-star-from/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportAllDeclaration { type: "ExportAllDeclaration", - assertions: [], + attributes: [], exported: null, exportKind: "type", source: Literal { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-star-from/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-star-from/snapshots/5-AST-Alignment-AST.shot index b14dfbca201..b8adf9144ef 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-star-from/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-star-from/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics export-type-star-from AST Alignment body: Array [ ExportAllDeclaration { type: 'ExportAllDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], exported: null, exportKind: 'type', source: Literal { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/1-TSESTree-AST.shot index 017fb0f7bed..a561b76d785 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: null, exportKind: "type", source: null, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/5-AST-Alignment-AST.shot index b34ddb187f6..689870ae13d 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics export-type AST Alignment - AST 1`] body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: null, exportKind: 'type', source: null, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/1-TSESTree-AST.shot index 7472805c426..f204c446014 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: TSDeclareFunction { type: "TSDeclareFunction", async: false, @@ -94,7 +94,7 @@ Program { }, ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: TSDeclareFunction { type: "TSDeclareFunction", async: false, @@ -182,7 +182,7 @@ Program { }, ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: FunctionDeclaration { type: "FunctionDeclaration", async: false, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/5-AST-Alignment-AST.shot index 4af306c530c..02138458e0e 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics function-overloads AST Alignment - body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: TSDeclareFunction { type: 'TSDeclareFunction', async: false, @@ -98,7 +99,8 @@ exports[`AST Fixtures legacy-fixtures basics function-overloads AST Alignment - }, ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: TSDeclareFunction { type: 'TSDeclareFunction', async: false, @@ -186,7 +188,8 @@ exports[`AST Fixtures legacy-fixtures basics function-overloads AST Alignment - }, ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: FunctionDeclaration { type: 'FunctionDeclaration', async: false, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/1-TSESTree-AST.shot index 0d8da7b441e..4722f5861cb 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: TSImportEqualsDeclaration { type: "TSImportEqualsDeclaration", id: Identifier { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/5-AST-Alignment-AST.shot index 51f7701bb76..82160c4219b 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics import-export-equal-declaration AST body: Array [ - ExportNamedDeclaration { - type: 'ExportNamedDeclaration', -- assertions: Array [], +- attributes: Array [], - declaration: TSImportEqualsDeclaration { - type: 'TSImportEqualsDeclaration', - id: Identifier { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/1-TSESTree-AST.shot index a518cab77f4..25194988c45 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: TSImportEqualsDeclaration { type: "TSImportEqualsDeclaration", id: Identifier { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/5-AST-Alignment-AST.shot index da9c9aa685e..6682e4bc9bb 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics import-export-equal-type-declaratio body: Array [ - ExportNamedDeclaration { - type: 'ExportNamedDeclaration', -- assertions: Array [], +- attributes: Array [], - declaration: TSImportEqualsDeclaration { - type: 'TSImportEqualsDeclaration', - id: Identifier { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/1-TSESTree-AST.shot index 4388729bbf1..fabd5b88820 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ImportDeclaration { type: "ImportDeclaration", - assertions: [], + attributes: [], importKind: "type", source: Literal { type: "Literal", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/5-AST-Alignment-AST.shot index 5775e847e8a..11207f69de9 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics import-type-default AST Alignment - body: Array [ ImportDeclaration { type: 'ImportDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], importKind: 'type', source: Literal { type: 'Literal', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/1-TSESTree-AST.shot index ee238f4d3eb..27974dbc371 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ImportDeclaration { type: "ImportDeclaration", - assertions: [], + attributes: [], importKind: "value", source: Literal { type: "Literal", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/5-AST-Alignment-AST.shot index bf6a7ff8209..c101526f93e 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics import-type-empty AST Alignment - A body: Array [ ImportDeclaration { type: 'ImportDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], importKind: 'value', source: Literal { type: 'Literal', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/1-TSESTree-AST.shot index 3331ec4e3a4..cf83d4e329c 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ImportDeclaration { type: "ImportDeclaration", - assertions: [], + attributes: [], importKind: "type", source: Literal { type: "Literal", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/5-AST-Alignment-AST.shot index 61bb15fad45..aba7f40265d 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics import-type-named-as AST Alignment body: Array [ ImportDeclaration { type: 'ImportDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], importKind: 'type', source: Literal { type: 'Literal', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/1-TSESTree-AST.shot index c9cf66adce7..68fc033a6e1 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ImportDeclaration { type: "ImportDeclaration", - assertions: [], + attributes: [], importKind: "type", source: Literal { type: "Literal", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/5-AST-Alignment-AST.shot index 3f0bb385ba5..a3d88acabc2 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics import-type-named AST Alignment - A body: Array [ ImportDeclaration { type: 'ImportDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], importKind: 'type', source: Literal { type: 'Literal', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/1-TSESTree-AST.shot index 539671c284e..fbac125e1d1 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ImportDeclaration { type: "ImportDeclaration", - assertions: [], + attributes: [], importKind: "type", source: Literal { type: "Literal", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/5-AST-Alignment-AST.shot index 91d204bd4e3..dfa2b73002a 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics import-type-star-as-ns AST Alignmen body: Array [ ImportDeclaration { type: 'ImportDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], importKind: 'type', source: Literal { type: 'Literal', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/1-TSESTree-AST.shot index fa59b2d0163..6f9d9a18ceb 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ImportDeclaration { type: "ImportDeclaration", - assertions: [ + attributes: [ ImportAttribute { type: "ImportAttribute", key: Identifier { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/5-AST-Alignment-AST.shot index d14ea9b3058..5716eb4c304 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics import-with-import-assertions AST A body: Array [ ImportDeclaration { type: 'ImportDeclaration', - assertions: Array [ +- attributes: Array [ ++ assertions: Array [ ImportAttribute { type: 'ImportAttribute', key: Identifier { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/1-TSESTree-AST.shot index 807baaad82c..7b8a4b6f27a 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/1-TSESTree-AST.shot @@ -1443,7 +1443,7 @@ Program { }, ImportDeclaration { type: "ImportDeclaration", - assertions: [], + attributes: [], importKind: "value", source: Literal { type: "Literal", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/5-AST-Alignment-AST.shot index 49b73e6d19b..161c119a17a 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/5-AST-Alignment-AST.shot @@ -1447,7 +1447,8 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A }, ImportDeclaration { type: 'ImportDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], importKind: 'value', source: Literal { type: 'Literal', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/1-TSESTree-AST.shot index a08cd544ed3..813fd7730f2 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: TSTypeAliasDeclaration { type: "TSTypeAliasDeclaration", declare: false, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/5-AST-Alignment-AST.shot index 616277e27e3..66dbfdf747e 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export-funct body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: TSTypeAliasDeclaration { type: 'TSTypeAliasDeclaration', - declare: false, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/1-TSESTree-AST.shot index de0e8827cce..2a5e8e2afe2 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: TSTypeAliasDeclaration { type: "TSTypeAliasDeclaration", declare: false, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/5-AST-Alignment-AST.shot index 9f9b094633b..44068bbaddb 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export-objec body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: TSTypeAliasDeclaration { type: 'TSTypeAliasDeclaration', - declare: false, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/1-TSESTree-AST.shot index ffe2ae38c04..238c66e660e 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: TSTypeAliasDeclaration { type: "TSTypeAliasDeclaration", declare: false, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/5-AST-Alignment-AST.shot index a36c1ee31da..435fa5a767f 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export AST A body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: TSTypeAliasDeclaration { type: 'TSTypeAliasDeclaration', - declare: false, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/1-TSESTree-AST.shot index 256b304a02d..efc42fbfc7c 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: null, exportKind: "value", source: Literal { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/5-AST-Alignment-AST.shot index 0371377d04c..189f9140bbb 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics type-only-export-specifiers AST Ali body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: null, exportKind: 'value', source: Literal { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/1-TSESTree-AST.shot index 6c6b075e434..82aea11224d 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ImportDeclaration { type: "ImportDeclaration", - assertions: [], + attributes: [], importKind: "value", source: Literal { type: "Literal", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/5-AST-Alignment-AST.shot index 313e18bc7f9..48020406f92 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures basics type-only-import-specifiers AST Ali body: Array [ ImportDeclaration { type: 'ImportDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], importKind: 'value', source: Literal { type: 'Literal', diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/1-TSESTree-AST.shot index 290ff765aed..6d8bbf6a43f 100644 --- a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/1-TSESTree-AST.shot @@ -6,7 +6,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: ClassDeclaration { type: "ClassDeclaration", abstract: false, diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/5-AST-Alignment-AST.shot index d0ef16bd7f4..04deb9723b8 100644 --- a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/5-AST-Alignment-AST.shot @@ -10,7 +10,8 @@ exports[`AST Fixtures legacy-fixtures class-decorators export-named-class-decora body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: ClassDeclaration { type: 'ClassDeclaration', - abstract: false, diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/1-TSESTree-AST.shot index 85106e819d0..f551e4c8f54 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/1-TSESTree-AST.shot @@ -11,7 +11,7 @@ Program { body: [ ImportDeclaration { type: "ImportDeclaration", - assertions: [], + attributes: [], importKind: "value", source: Literal { type: "Literal", diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/5-AST-Alignment-AST.shot index c77ae1fc5ef..557394087d1 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/5-AST-Alignment-AST.shot @@ -15,7 +15,8 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules ambient-module-decl body: Array [ ImportDeclaration { type: 'ImportDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], importKind: 'value', source: Literal { type: 'Literal', diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/1-TSESTree-AST.shot index bc1ef7402cc..71b0cca8c72 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/1-TSESTree-AST.shot @@ -11,7 +11,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: TSDeclareFunction { type: "TSDeclareFunction", async: false, diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/5-AST-Alignment-AST.shot index 8732ff7462b..56e2aae4505 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/5-AST-Alignment-AST.shot @@ -15,7 +15,8 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules declare-namespace-w body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: TSDeclareFunction { type: 'TSDeclareFunction', async: false, @@ -106,14 +107,14 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules declare-namespace-w - decorators: Array [], - name: 'Selection', - optional: false, - +- - range: [140, 149], - loc: { - start: { column: 44, line: 4 }, - end: { column: 53, line: 4 }, - }, - }, -- + range: [140, 154], loc: { start: { column: 44, line: 4 }, diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/1-TSESTree-AST.shot index c4a8a3d4871..b7872a30a1c 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/1-TSESTree-AST.shot @@ -11,7 +11,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: VariableDeclaration { type: "VariableDeclaration", declarations: [ @@ -70,7 +70,7 @@ Program { }, ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: ClassDeclaration { type: "ClassDeclaration", abstract: false, @@ -261,7 +261,7 @@ Program { }, ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: TSModuleDeclaration { type: "TSModuleDeclaration", body: TSModuleBlock { @@ -269,7 +269,7 @@ Program { body: [ ExportNamedDeclaration { type: "ExportNamedDeclaration", - assertions: [], + attributes: [], declaration: TSInterfaceDeclaration { type: "TSInterfaceDeclaration", body: TSInterfaceBody { diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/5-AST-Alignment-AST.shot index f54c0978f19..e757d3cad1b 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/5-AST-Alignment-AST.shot @@ -15,7 +15,8 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: VariableDeclaration { type: 'VariableDeclaration', declarations: Array [ @@ -74,7 +75,8 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod }, ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: ClassDeclaration { type: 'ClassDeclaration', - abstract: false, @@ -265,7 +267,8 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod }, ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: TSModuleDeclaration { type: 'TSModuleDeclaration', body: TSModuleBlock { @@ -273,7 +276,8 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod body: Array [ ExportNamedDeclaration { type: 'ExportNamedDeclaration', - assertions: Array [], +- attributes: Array [], ++ assertions: Array [], declaration: TSInterfaceDeclaration { type: 'TSInterfaceDeclaration', body: TSInterfaceBody { diff --git a/packages/ast-spec/tests/fixtures-with-differences-ast.shot b/packages/ast-spec/tests/fixtures-with-differences-ast.shot index d566a5a5ddc..a41c223827d 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-ast.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-ast.shot @@ -19,6 +19,7 @@ exports[`AST Fixtures List fixtures with AST differences 1`] = ` "declaration/ExportAllDeclaration/fixtures/kind-type/fixture.ts", "declaration/ExportAllDeclaration/fixtures/named/fixture.ts", "declaration/ExportAllDeclaration/fixtures/type-kind/fixture.ts", + "declaration/ExportAllDeclaration/fixtures/unnamed/fixture.ts", "declaration/ExportDefaultDeclaration/fixtures/anonymous-class/fixture.ts", "declaration/ExportDefaultDeclaration/fixtures/anonymous-function/fixture.ts", "declaration/ExportDefaultDeclaration/fixtures/class-expression/fixture.ts", @@ -52,7 +53,9 @@ exports[`AST Fixtures List fixtures with AST differences 1`] = ` "declaration/ImportDeclaration/fixtures/default-and-namespace/fixture.ts", "declaration/ImportDeclaration/fixtures/default/fixture.ts", "declaration/ImportDeclaration/fixtures/named-many/fixture.ts", + "declaration/ImportDeclaration/fixtures/named-none/fixture.ts", "declaration/ImportDeclaration/fixtures/named-one/fixture.ts", + "declaration/ImportDeclaration/fixtures/side-effect/fixture.ts", "declaration/TSDeclareFunction/fixtures/empty/fixture.ts", "declaration/TSDeclareFunction/fixtures/generator/fixture.ts", "declaration/TSDeclareFunction/fixtures/param-many/fixture.ts", diff --git a/packages/eslint-plugin/src/rules/consistent-type-imports.ts b/packages/eslint-plugin/src/rules/consistent-type-imports.ts index 57e15ea2917..d6128fafb42 100644 --- a/packages/eslint-plugin/src/rules/consistent-type-imports.ts +++ b/packages/eslint-plugin/src/rules/consistent-type-imports.ts @@ -277,7 +277,7 @@ export default createRule({ * ``` * https://github.com/typescript-eslint/typescript-eslint/issues/7527 */ - if (report.node.assertions.length === 0) { + if (report.node.attributes.length === 0) { context.report({ node: report.node, messageId: 'typeOverValue', @@ -632,7 +632,7 @@ export default createRule({ // import * as types from 'foo' // checks for presence of import assertions - if (node.assertions.length === 0) { + if (node.attributes.length === 0) { yield* fixInsertTypeSpecifierForImportDeclaration(fixer, node, false); } return; diff --git a/packages/eslint-plugin/src/rules/no-restricted-imports.ts b/packages/eslint-plugin/src/rules/no-restricted-imports.ts index af99250310c..1fbd584a120 100644 --- a/packages/eslint-plugin/src/rules/no-restricted-imports.ts +++ b/packages/eslint-plugin/src/rules/no-restricted-imports.ts @@ -306,6 +306,7 @@ export default createRule({ type: AST_NODE_TYPES.ImportDeclaration, source: node.moduleReference.expression, assertions: [], + attributes: [], specifiers: [ { ...node.id, diff --git a/packages/scope-manager/src/lib/es5.ts b/packages/scope-manager/src/lib/es5.ts index 9a3ba7093f1..ff63d93273e 100644 --- a/packages/scope-manager/src/lib/es5.ts +++ b/packages/scope-manager/src/lib/es5.ts @@ -34,6 +34,7 @@ export const es5 = { ImportMeta: TYPE, ImportCallOptions: TYPE, ImportAssertions: TYPE, + ImportAttributes: TYPE, Math: TYPE_VALUE, Date: TYPE_VALUE, DateConstructor: TYPE, diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index eb4e7c39ea1..d922495e8d6 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -199,16 +199,24 @@ export class Converter { result.type === AST_NODE_TYPES.TSInterfaceDeclaration || result.type === AST_NODE_TYPES.TSTypeAliasDeclaration; const isDeclare = 'declare' in result && result.declare; - return this.createNode(node, { - type: AST_NODE_TYPES.ExportNamedDeclaration, + return this.createNode( + node, // @ts-expect-error - TODO, narrow the types here - declaration: result, - specifiers: [], - source: null, - exportKind: isType || isDeclare ? 'type' : 'value', - range: [exportKeyword.getStart(this.ast), result.range[1]], - assertions: [], - }); + this.#withDeprecatedAliasGetter( + { + type: AST_NODE_TYPES.ExportNamedDeclaration, + declaration: result, + specifiers: [], + source: null, + exportKind: isType || isDeclare ? 'type' : 'value', + range: [exportKeyword.getStart(this.ast), result.range[1]], + attributes: [], + }, + 'assertions', + 'attributes', + true, + ), + ); } return result; @@ -688,8 +696,8 @@ export class Converter { }); } - private convertAssertClasue( - node: ts.AssertClause | undefined, + private convertImportAttributes( + node: ts.ImportAttributes | undefined, ): TSESTree.ImportAttribute[] { return node === undefined ? [] @@ -1858,13 +1866,24 @@ export class Converter { case SyntaxKind.ImportDeclaration: { this.assertModuleSpecifier(node, false); - const result = this.createNode(node, { - type: AST_NODE_TYPES.ImportDeclaration, - source: this.convertChild(node.moduleSpecifier), - specifiers: [], - importKind: 'value', - assertions: this.convertAssertClasue(node.assertClause), - }); + const result = this.createNode( + node, + this.#withDeprecatedAliasGetter( + { + type: AST_NODE_TYPES.ImportDeclaration, + source: this.convertChild(node.moduleSpecifier), + specifiers: [], + importKind: 'value', + attributes: this.convertImportAttributes( + // eslint-disable-next-line deprecation/deprecation -- TS <5.3 + node.attributes ?? node.assertClause, + ), + }, + 'assertions', + 'attributes', + true, + ), + ); if (node.importClause) { if (node.importClause.isTypeOnly) { @@ -1925,33 +1944,50 @@ export class Converter { case SyntaxKind.ExportDeclaration: { if (node.exportClause?.kind === SyntaxKind.NamedExports) { this.assertModuleSpecifier(node, true); - return this.createNode(node, { - type: AST_NODE_TYPES.ExportNamedDeclaration, - source: this.convertChild(node.moduleSpecifier), - specifiers: node.exportClause.elements.map(el => - this.convertChild(el), + return this.createNode( + node, + this.#withDeprecatedAliasGetter( + { + type: AST_NODE_TYPES.ExportNamedDeclaration, + source: this.convertChild(node.moduleSpecifier), + specifiers: node.exportClause.elements.map(el => + this.convertChild(el), + ), + exportKind: node.isTypeOnly ? 'type' : 'value', + declaration: null, + attributes: this.convertImportAttributes( + // eslint-disable-next-line deprecation/deprecation -- TS <5.3 + node.attributes ?? node.assertClause, + ), + }, + 'assertions', + 'attributes', + true, ), - exportKind: node.isTypeOnly ? 'type' : 'value', - declaration: null, - assertions: this.convertAssertClasue(node.assertClause), - }); + ); } this.assertModuleSpecifier(node, false); - return this.createNode(node, { - type: AST_NODE_TYPES.ExportAllDeclaration, - source: this.convertChild(node.moduleSpecifier), - exportKind: node.isTypeOnly ? 'type' : 'value', - exported: - // note - for compat with 3.7.x, where node.exportClause is always undefined and - // SyntaxKind.NamespaceExport does not exist yet (i.e. is undefined), this - // cannot be shortened to an optional chain, or else you end up with - // undefined === undefined, and the true path will hard error at runtime - node.exportClause && - node.exportClause.kind === SyntaxKind.NamespaceExport - ? this.convertChild(node.exportClause.name) - : null, - assertions: this.convertAssertClasue(node.assertClause), - }); + return this.createNode( + node, + this.#withDeprecatedAliasGetter( + { + type: AST_NODE_TYPES.ExportAllDeclaration, + source: this.convertChild(node.moduleSpecifier), + exportKind: node.isTypeOnly ? 'type' : 'value', + exported: + node.exportClause?.kind === SyntaxKind.NamespaceExport + ? this.convertChild(node.exportClause.name) + : null, + attributes: this.convertImportAttributes( + // eslint-disable-next-line deprecation/deprecation -- TS <5.3 + node.attributes ?? node.assertClause, + ), + }, + 'assertions', + 'attributes', + true, + ), + ); } case SyntaxKind.ExportSpecifier: @@ -3144,7 +3180,7 @@ export class Converter { }); } - case SyntaxKind.AssertEntry: { + case SyntaxKind.ImportAttribute: { return this.createNode(node, { type: AST_NODE_TYPES.ImportAttribute, key: this.convertChild(node.name), @@ -3416,8 +3452,9 @@ export class Converter { node: Properties, aliasKey: AliasKey, valueKey: ValueKey, + suppressWarnings = false, ): Properties & Record { - let warned = false; + let warned = suppressWarnings; Object.defineProperty(node, aliasKey, { configurable: true, diff --git a/packages/typescript-estree/src/create-program/createIsolatedProgram.ts b/packages/typescript-estree/src/create-program/createIsolatedProgram.ts index 0b6520f22aa..ae646e6ad7b 100644 --- a/packages/typescript-estree/src/create-program/createIsolatedProgram.ts +++ b/packages/typescript-estree/src/create-program/createIsolatedProgram.ts @@ -65,6 +65,7 @@ function createIsolatedProgram( const program = ts.createProgram( [parseSettings.filePath], { + jsDocParsingMode: ts.JSDocParsingMode?.ParseForTypeInfo, noResolve: true, target: ts.ScriptTarget.Latest, jsx: parseSettings.jsx ? ts.JsxEmit.Preserve : undefined, diff --git a/packages/typescript-estree/src/create-program/createProjectService.ts b/packages/typescript-estree/src/create-program/createProjectService.ts index 333d221f85b..341dd77ae18 100644 --- a/packages/typescript-estree/src/create-program/createProjectService.ts +++ b/packages/typescript-estree/src/create-program/createProjectService.ts @@ -11,6 +11,7 @@ export type TypeScriptProjectService = ts.server.ProjectService; export function createProjectService(): TypeScriptProjectService { // We import this lazily to avoid its cost for users who don't use the service + // TODO: Once we drop support for TS<5.3 we can import from "typescript" directly const tsserver = require('typescript/lib/tsserverlibrary') as typeof ts; // TODO: see getWatchProgramsForProjects diff --git a/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts b/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts index 4694c85445f..f78ba52fb17 100644 --- a/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts +++ b/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts @@ -77,7 +77,11 @@ export interface EstreeToTsNodeTypes { | ts.Token; [AST_NODE_TYPES.PrivateIdentifier]: ts.PrivateIdentifier; [AST_NODE_TYPES.IfStatement]: ts.IfStatement; - [AST_NODE_TYPES.ImportAttribute]: ts.AssertEntry; + // eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum + [AST_NODE_TYPES.ImportAttribute]: 'ImportAttribute' extends keyof typeof ts + ? ts.ImportAttribute + : // eslint-disable-next-line deprecation/deprecation + ts.AssertEntry; [AST_NODE_TYPES.ImportDeclaration]: ts.ImportDeclaration; [AST_NODE_TYPES.ImportDefaultSpecifier]: ts.ImportClause; [AST_NODE_TYPES.ImportExpression]: ts.CallExpression; diff --git a/packages/typescript-estree/src/ts-estree/ts-nodes.ts b/packages/typescript-estree/src/ts-estree/ts-nodes.ts index 3e9eab7fe8d..51a990b3e81 100644 --- a/packages/typescript-estree/src/ts-estree/ts-nodes.ts +++ b/packages/typescript-estree/src/ts-estree/ts-nodes.ts @@ -2,25 +2,29 @@ import type * as ts from 'typescript'; // Workaround to support new TS version features for consumers on old TS versions // Eg: https://github.com/typescript-eslint/typescript-eslint/issues/2388, https://github.com/typescript-eslint/typescript-eslint/issues/2784 -/* eslint-disable @typescript-eslint/no-empty-interface */ +/* eslint-disable @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error, @typescript-eslint/no-empty-interface */ declare module 'typescript' { - // added in TS 4.5 + // @ts-ignore - added in TS 4.5 export interface AssertClause extends ts.Node {} + // @ts-ignore - added in TS 4.5 export interface AssertEntry extends ts.Node {} // added in TS 4.9 export interface SatisfiesExpression extends ts.Node {} // added in TS 5.1 export interface JsxNamespacedName extends ts.Node {} + // added in TS 5.3 + export interface ImportAttribute extends ts.Node {} + export interface ImportAttributes extends ts.Node {} } -/* eslint-enable @typescript-eslint/no-empty-interface */ +/* eslint-enable @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error, @typescript-eslint/no-empty-interface */ export type TSToken = ts.Token; export type TSNode = - | ts.AssertClause - | ts.AssertEntry | ts.Modifier | ts.Identifier + | ts.ImportAttribute + | ts.ImportAttributes | ts.PrivateIdentifier | ts.QualifiedName | ts.ComputedPropertyName @@ -178,9 +182,9 @@ export type TSNode = | ts.ExportAssignment | ts.SourceFile | ts.Bundle - // eslint-disable-next-line deprecation/deprecation -- intentional for old TS versions + /* eslint-disable-next-line deprecation/deprecation -- intentional for old TS versions */ | ts.InputFiles - // eslint-disable-next-line deprecation/deprecation -- intentional for old TS versions + /* eslint-disable-next-line deprecation/deprecation -- intentional for old TS versions */ | ts.UnparsedSource | ts.JsonMinusNumericLiteral | ts.TemplateLiteralTypeNode diff --git a/packages/typescript-estree/src/useProgramFromProjectService.ts b/packages/typescript-estree/src/useProgramFromProjectService.ts index 16a7933a671..59f6b0fe50a 100644 --- a/packages/typescript-estree/src/useProgramFromProjectService.ts +++ b/packages/typescript-estree/src/useProgramFromProjectService.ts @@ -1,5 +1,4 @@ import path from 'path'; -import type * as ts from 'typescript'; import type { server } from 'typescript/lib/tsserverlibrary'; import { createProjectProgram } from './create-program/createProjectProgram'; @@ -30,7 +29,7 @@ export function useProgramFromProjectService( return undefined; } - return createProjectProgram(parseSettings, [program as ts.Program]); + return createProjectProgram(parseSettings, [program]); function absolutify(filePath: string): string { return path.isAbsolute(filePath) diff --git a/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap index 0a1c9eb2ace..3b3e9443a84 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap @@ -38,6 +38,7 @@ exports[`convert deeplyCopy should convert array of nodes 1`] = ` "impliedNodeFormat": undefined, "imports": undefined, "isDeclarationFile": false, + "jsDocParsingMode": 0, "languageVariant": 1, "languageVersion": 99, "libReferenceDirectives": [], @@ -67,7 +68,6 @@ exports[`convert deeplyCopy should convert array of nodes 1`] = ` 12, ], "referencedFiles": [], - "resolvedModules": undefined, "resolvedPath": "", "scriptKind": 4, "setExternalModuleIndicator": [Function], diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semanticInfo.test.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semanticInfo.test.ts.snap index 79772deb70e..d7402d08234 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semanticInfo.test.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semanticInfo.test.ts.snap @@ -304,7 +304,7 @@ exports[`semanticInfo fixtures/import-file.src 1`] = ` { "body": [ { - "assertions": [], + "attributes": [], "importKind": "value", "loc": { "end": { diff --git a/yarn.lock b/yarn.lock index cf39874c276..0a077e9a2b3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3781,7 +3781,7 @@ __metadata: languageName: node linkType: hard -"@microsoft/api-extractor@npm:^7.36.1": +"@microsoft/api-extractor@npm:7.38.0": version: 7.38.0 resolution: "@microsoft/api-extractor@npm:7.38.0" dependencies: @@ -3803,6 +3803,28 @@ __metadata: languageName: node linkType: hard +"@microsoft/api-extractor@patch:@microsoft/api-extractor@npm%3A7.38.0#./.yarn/patches/@microsoft-api-extractor-npm-7.38.0-955f1e0725.patch::locator=%40typescript-eslint%2Ftypescript-eslint%40workspace%3A.": + version: 7.38.0 + resolution: "@microsoft/api-extractor@patch:@microsoft/api-extractor@npm%3A7.38.0#./.yarn/patches/@microsoft-api-extractor-npm-7.38.0-955f1e0725.patch::version=7.38.0&hash=ad5a63&locator=%40typescript-eslint%2Ftypescript-eslint%40workspace%3A." + dependencies: + "@microsoft/api-extractor-model": 7.28.2 + "@microsoft/tsdoc": 0.14.2 + "@microsoft/tsdoc-config": ~0.16.1 + "@rushstack/node-core-library": 3.61.0 + "@rushstack/rig-package": 0.5.1 + "@rushstack/ts-command-line": 4.16.1 + colors: ~1.2.1 + lodash: ~4.17.15 + resolve: ~1.22.1 + semver: ~7.5.4 + source-map: ~0.6.1 + typescript: ~5.0.4 + bin: + api-extractor: bin/api-extractor + checksum: 731407252d63ff0046e7a60f8fd73aa162cf6f3a2808dd786d608b17ba528365a55f4c119c8f16901d73fa3f0c12b82284e4066cb0372c47bfe544c17f64ecff + languageName: node + linkType: hard + "@microsoft/tsdoc-config@npm:~0.16.1": version: 0.16.1 resolution: "@microsoft/tsdoc-config@npm:0.16.1" @@ -5782,7 +5804,7 @@ __metadata: "@babel/core": "*" "@babel/eslint-parser": "*" "@babel/parser": "*" - "@microsoft/api-extractor": ^7.36.1 + "@microsoft/api-extractor": ^7.38.0 glob: "*" jest: 29.7.0 jest-diff: ^29.6.2 @@ -6088,7 +6110,7 @@ __metadata: ts-node: 10.7.0 tslint: ^6.1.3 tsx: ^3.12.7 - typescript: ">=4.3.5 <5.3.0" + typescript: ">=4.3.5 <5.4.0" languageName: unknown linkType: soft @@ -20212,33 +20234,33 @@ __metadata: languageName: node linkType: hard -"typescript@npm:5.2.2": - version: 5.2.2 - resolution: "typescript@npm:5.2.2" +"typescript@npm:5.3.0-beta": + version: 5.3.0-beta + resolution: "typescript@npm:5.3.0-beta" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 7912821dac4d962d315c36800fe387cdc0a6298dba7ec171b350b4a6e988b51d7b8f051317786db1094bd7431d526b648aba7da8236607febb26cf5b871d2d3c + checksum: 12c5b05df8be536c3f5789323ca2e2f21ab6b7571bd21407b152c080be1dc8628c3cd9fb5fa342a304a266f5ad22827f3a27b7961da1600d27890be93f3e2d73 languageName: node linkType: hard -"typescript@patch:typescript@npm%3A5.2.2#./.yarn/patches/typescript-npm-5.2.2-01717e9f84.patch::locator=%40typescript-eslint%2Ftypescript-eslint%40workspace%3A.": - version: 5.2.2 - resolution: "typescript@patch:typescript@npm%3A5.2.2#./.yarn/patches/typescript-npm-5.2.2-01717e9f84.patch::version=5.2.2&hash=c1c928&locator=%40typescript-eslint%2Ftypescript-eslint%40workspace%3A." +"typescript@patch:typescript@npm%3A5.3.0-beta#./.yarn/patches/typescript-npm-5.3.0-beta-33b1e90865.patch::locator=%40typescript-eslint%2Ftypescript-eslint%40workspace%3A.": + version: 5.3.0-beta + resolution: "typescript@patch:typescript@npm%3A5.3.0-beta#./.yarn/patches/typescript-npm-5.3.0-beta-33b1e90865.patch::version=5.3.0-beta&hash=aba397&locator=%40typescript-eslint%2Ftypescript-eslint%40workspace%3A." bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 68f0d660e40a032ed507e2dea44a2729f522a2d1a9b0597aa5459cf7401e244245856241189313087453f705b6bdc11639fcb9266425ddb0c4404233f4669b5c + checksum: 85a8cc0ce7b9d4243db899dbf77632d63cf32818cfc076f27e929f1b89c062c2a94f5fa2f0a72e9fc315164532aac1580c9cad5b453f4a4aed464557593c8168 languageName: node linkType: hard -"typescript@patch:typescript@patch%3Atypescript@npm%253A5.2.2%23./.yarn/patches/typescript-npm-5.2.2-01717e9f84.patch%3A%3Alocator=%2540typescript-eslint%252Ftypescript-eslint%2540workspace%253A.#~builtin": - version: 5.2.2 - resolution: "typescript@patch:typescript@patch%3Atypescript@npm%253A5.2.2%23./.yarn/patches/typescript-npm-5.2.2-01717e9f84.patch%3A%3Aversion=5.2.2&hash=c1c928&locator=%2540typescript-eslint%252Ftypescript-eslint%2540workspace%253A.#~builtin::version=5.2.2&hash=f3b441" +"typescript@patch:typescript@patch%3Atypescript@npm%253A5.3.0-beta%23./.yarn/patches/typescript-npm-5.3.0-beta-33b1e90865.patch%3A%3Alocator=%2540typescript-eslint%252Ftypescript-eslint%2540workspace%253A.#~builtin": + version: 5.3.0-beta + resolution: "typescript@patch:typescript@patch%3Atypescript@npm%253A5.3.0-beta%23./.yarn/patches/typescript-npm-5.3.0-beta-33b1e90865.patch%3A%3Aversion=5.3.0-beta&hash=aba397&locator=%2540typescript-eslint%252Ftypescript-eslint%2540workspace%253A.#~builtin::version=5.3.0-beta&hash=29ae49" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 44eead0a64bb01bc40b0a8ba44f56ae0caf7c7afe3d6ef723bcb2259a7b8aa98d24096e478ba0bcd4fe9295b686d9324e79d1636c16b08caedfec14e9dead065 + checksum: d1ed47d2a7f35e4692c439bca41f0622be732f33927e59afe4af9c6640219a2f1cc7c4622852787a96c5300f2b88fb06bb46b5125ae8db2c080b0fad2f12ae98 languageName: node linkType: hard