From 0c7af5262634d131859eaae3b4d1c26c33bbb06a Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 23 Feb 2023 20:23:19 -0500 Subject: [PATCH 1/6] feat: warn on deprecated AST property accesses --- docs/architecture/TypeScript-ESTree.mdx | 5 + .../snapshots/1-TSESTree-AST.shot | 20 - .../snapshots/5-AST-Alignment-AST.shot | 21 +- .../snapshots/1-TSESTree-AST.shot | 30 -- .../snapshots/5-AST-Alignment-AST.shot | 31 +- .../snapshots/1-TSESTree-AST.shot | 20 - .../snapshots/5-AST-Alignment-AST.shot | 51 ++- .../snapshots/1-TSESTree-AST.shot | 20 - .../snapshots/5-AST-Alignment-AST.shot | 51 ++- .../snapshots/1-TSESTree-AST.shot | 49 --- .../snapshots/5-AST-Alignment-AST.shot | 50 +-- .../snapshots/1-TSESTree-AST.shot | 30 -- .../snapshots/5-AST-Alignment-AST.shot | 31 +- .../snapshots/1-TSESTree-AST.shot | 49 --- .../snapshots/5-AST-Alignment-AST.shot | 52 +-- .../snapshots/1-TSESTree-AST.shot | 30 -- .../snapshots/5-AST-Alignment-AST.shot | 33 +- .../snapshots/1-TSESTree-AST.shot | 30 -- .../snapshots/5-AST-Alignment-AST.shot | 61 ++- .../snapshots/1-TSESTree-AST.shot | 41 -- .../snapshots/5-AST-Alignment-AST.shot | 73 ++-- .../snapshots/1-TSESTree-AST.shot | 20 - .../snapshots/5-AST-Alignment-AST.shot | 51 ++- .../snapshots/1-TSESTree-AST.shot | 30 -- .../snapshots/5-AST-Alignment-AST.shot | 31 +- .../snapshots/1-TSESTree-AST.shot | 260 ------------- .../snapshots/5-AST-Alignment-AST.shot | 353 ++++-------------- .../snapshots/1-TSESTree-AST.shot | 40 -- .../snapshots/5-AST-Alignment-AST.shot | 72 ++-- .../snapshots/1-TSESTree-AST.shot | 20 - .../snapshots/5-AST-Alignment-AST.shot | 51 ++- .../snapshots/1-TSESTree-AST.shot | 29 -- .../snapshots/5-AST-Alignment-AST.shot | 60 ++- .../snapshots/1-TSESTree-AST.shot | 30 -- .../snapshots/5-AST-Alignment-AST.shot | 61 ++- .../snapshots/1-TSESTree-AST.shot | 30 -- .../snapshots/5-AST-Alignment-AST.shot | 61 ++- .../snapshots/1-TSESTree-AST.shot | 90 ----- .../snapshots/5-AST-Alignment-AST.shot | 129 ++----- .../snapshots/1-TSESTree-AST.shot | 120 ------ .../snapshots/5-AST-Alignment-AST.shot | 144 +------ .../snapshots/1-TSESTree-AST.shot | 30 -- .../snapshots/5-AST-Alignment-AST.shot | 37 +- .../snapshots/1-TSESTree-AST.shot | 20 - .../snapshots/5-AST-Alignment-AST.shot | 40 +- .../snapshots/1-TSESTree-AST.shot | 50 --- .../snapshots/5-AST-Alignment-AST.shot | 52 +-- .../snapshots/1-TSESTree-AST.shot | 50 --- .../snapshots/5-AST-Alignment-AST.shot | 52 +-- .../snapshots/1-TSESTree-AST.shot | 30 -- .../snapshots/5-AST-Alignment-AST.shot | 31 +- .../snapshots/1-TSESTree-AST.shot | 20 - .../snapshots/5-AST-Alignment-AST.shot | 51 ++- .../snapshots/1-TSESTree-AST.shot | 41 -- .../snapshots/5-AST-Alignment-AST.shot | 72 ++-- .../snapshots/1-TSESTree-AST.shot | 120 ------ .../snapshots/5-AST-Alignment-AST.shot | 250 +++++-------- .../snapshots/1-TSESTree-AST.shot | 40 -- .../snapshots/5-AST-Alignment-AST.shot | 71 ++-- .../snapshots/1-TSESTree-AST.shot | 39 -- .../snapshots/5-AST-Alignment-AST.shot | 70 ++-- .../snapshots/1-TSESTree-AST.shot | 30 -- .../snapshots/5-AST-Alignment-AST.shot | 61 ++- .../snapshots/1-TSESTree-AST.shot | 90 ----- .../snapshots/5-AST-Alignment-AST.shot | 152 +++----- .../snapshots/1-TSESTree-AST.shot | 20 - .../snapshots/5-AST-Alignment-AST.shot | 51 ++- .../snapshots/1-TSESTree-AST.shot | 151 -------- .../snapshots/5-AST-Alignment-AST.shot | 296 +++++---------- .../snapshots/1-TSESTree-AST.shot | 30 -- .../snapshots/5-AST-Alignment-AST.shot | 31 +- .../typescript-estree/src/ast-converter.ts | 4 +- packages/typescript-estree/src/convert.ts | 235 ++++++++---- .../src/parseSettings/createParseSettings.ts | 3 + .../src/parseSettings/index.ts | 5 + .../typescript-estree/src/parser-options.ts | 5 + .../lib/__snapshots__/convert.test.ts.snap | 114 ------ .../lib/__snapshots__/parse.test.ts.snap | 7 - .../tests/lib/convert.test.ts | 97 +++-- .../website/src/components/linter/config.ts | 1 + 80 files changed, 948 insertions(+), 4061 deletions(-) diff --git a/docs/architecture/TypeScript-ESTree.mdx b/docs/architecture/TypeScript-ESTree.mdx index 5501c3f7131..89927195c59 100644 --- a/docs/architecture/TypeScript-ESTree.mdx +++ b/docs/architecture/TypeScript-ESTree.mdx @@ -36,6 +36,11 @@ interface ParseOptions { */ comment?: boolean; + /** + * Whether deprecated AST properties should skip calling console.warn on accesses. + */ + suppressDeprecatedPropertyWarnings?: boolean; + /** * An array of modules to turn explicit debugging on for. * - 'typescript-eslint' is the same as setting the env var `DEBUG=typescript-eslint:*` diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/1-TSESTree-AST.shot index 313a1a2ca5c..983182963c4 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/1-TSESTree-AST.shot @@ -56,26 +56,6 @@ Program { end: { column: 29, line: 1 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSStringKeyword { - type: "TSStringKeyword", - - range: [22, 28], - loc: { - start: { column: 22, line: 1 }, - end: { column: 28, line: 1 }, - }, - }, - ], - - range: [21, 29], - loc: { - start: { column: 21, line: 1 }, - end: { column: 29, line: 1 }, - }, - }, range: [0, 32], loc: { diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/5-AST-Alignment-AST.shot index 91f3d48279a..be4f4f78362 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/5-AST-Alignment-AST.shot @@ -41,26 +41,7 @@ exports[`AST Fixtures declaration ClassDeclaration extends-type-param AST Alignm }, }, - superTypeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSStringKeyword { -- type: 'TSStringKeyword', -- -- range: [22, 28], -- loc: { -- start: { column: 22, line: 1 }, -- end: { column: 28, line: 1 }, -- }, -- }, -- ], -- -- range: [21, 29], -- loc: { -- start: { column: 21, line: 1 }, -- end: { column: 29, line: 1 }, -- }, -- }, - superTypeParameters: TSTypeParameterInstantiation { ++ superTypeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSStringKeyword { diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/1-TSESTree-AST.shot index ef17890bb62..35fc0f627fe 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/1-TSESTree-AST.shot @@ -66,36 +66,6 @@ Program { end: { column: 27, line: 1 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "T", - - range: [25, 26], - loc: { - start: { column: 25, line: 1 }, - end: { column: 26, line: 1 }, - }, - }, - - range: [25, 26], - loc: { - start: { column: 25, line: 1 }, - end: { column: 26, line: 1 }, - }, - }, - ], - - range: [24, 27], - loc: { - start: { column: 24, line: 1 }, - end: { column: 27, line: 1 }, - }, - }, typeParameters: TSTypeParameterDeclaration { type: "TSTypeParameterDeclaration", params: Array [ diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/5-AST-Alignment-AST.shot index 5c6479136e9..81a386031e3 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/5-AST-Alignment-AST.shot @@ -41,36 +41,7 @@ exports[`AST Fixtures declaration ClassDeclaration type-parameters-extends-type- }, }, - superTypeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'T', -- -- range: [25, 26], -- loc: { -- start: { column: 25, line: 1 }, -- end: { column: 26, line: 1 }, -- }, -- }, -- -- range: [25, 26], -- loc: { -- start: { column: 25, line: 1 }, -- end: { column: 26, line: 1 }, -- }, -- }, -- ], -- -- range: [24, 27], -- loc: { -- start: { column: 24, line: 1 }, -- end: { column: 27, line: 1 }, -- }, -- }, - superTypeParameters: TSTypeParameterInstantiation { ++ superTypeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { 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 288e7b2ed70..524d612cc36 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 @@ -71,26 +71,6 @@ Program { end: { column: 34, line: 4 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSStringKeyword { - type: "TSStringKeyword", - - range: [147, 153], - loc: { - start: { column: 35, line: 4 }, - end: { column: 41, line: 4 }, - }, - }, - ], - - range: [146, 154], - loc: { - start: { column: 34, line: 4 }, - end: { column: 42, line: 4 }, - }, - }, range: [139, 154], loc: { 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 a39d1d8f6e2..04eb35cf995 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 @@ -51,36 +51,17 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-method typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSStringKeyword { -- type: 'TSStringKeyword', -- -- range: [147, 153], -- loc: { -- start: { column: 35, line: 4 }, -- end: { column: 41, line: 4 }, -- }, -- }, -- ], -- -- range: [146, 154], -- loc: { -- start: { column: 34, line: 4 }, -- end: { column: 42, line: 4 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'Promise', - - range: [139, 146], - loc: { - start: { column: 27, line: 4 }, - end: { column: 34, line: 4 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Promise', ++ ++ range: [139, 146], ++ loc: { ++ start: { column: 27, line: 4 }, ++ end: { column: 34, line: 4 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSStringKeyword { @@ -98,6 +79,16 @@ 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', +- name: 'Promise', +- +- range: [139, 146], +- loc: { +- start: { column: 27, line: 4 }, +- end: { column: 34, 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 2fc857bfdba..e26717d3ce7 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 @@ -72,26 +72,6 @@ Program { end: { column: 26, line: 4 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSStringKeyword { - type: "TSStringKeyword", - - range: [139, 145], - loc: { - start: { column: 27, line: 4 }, - end: { column: 33, line: 4 }, - }, - }, - ], - - range: [138, 146], - loc: { - start: { column: 26, line: 4 }, - end: { column: 34, line: 4 }, - }, - }, range: [131, 146], loc: { 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 4db0ba1cb67..433df074662 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 @@ -49,36 +49,17 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-optional-method typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSStringKeyword { -- type: 'TSStringKeyword', -- -- range: [139, 145], -- loc: { -- start: { column: 27, line: 4 }, -- end: { column: 33, line: 4 }, -- }, -- }, -- ], -- -- range: [138, 146], -- loc: { -- start: { column: 26, line: 4 }, -- end: { column: 34, line: 4 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'Promise', - - range: [131, 138], - loc: { - start: { column: 19, line: 4 }, - end: { column: 26, line: 4 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Promise', ++ ++ range: [131, 138], ++ loc: { ++ start: { column: 19, line: 4 }, ++ end: { column: 26, line: 4 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSStringKeyword { @@ -96,6 +77,16 @@ 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', +- name: 'Promise', +- +- range: [131, 138], +- loc: { +- start: { column: 19, line: 4 }, +- end: { column: 26, line: 4 }, }, }, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/1-TSESTree-AST.shot index ded2419b191..abcbcbaab3f 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/1-TSESTree-AST.shot @@ -85,55 +85,6 @@ Program { end: { column: 40, line: 3 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "C", - - range: [108, 109], - loc: { - start: { column: 35, line: 3 }, - end: { column: 36, line: 3 }, - }, - }, - - range: [108, 109], - loc: { - start: { column: 35, line: 3 }, - end: { column: 36, line: 3 }, - }, - }, - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "D", - - range: [111, 112], - loc: { - start: { column: 38, line: 3 }, - end: { column: 39, line: 3 }, - }, - }, - - range: [111, 112], - loc: { - start: { column: 38, line: 3 }, - end: { column: 39, line: 3 }, - }, - }, - ], - - range: [107, 113], - loc: { - start: { column: 34, line: 3 }, - end: { column: 40, line: 3 }, - }, - }, typeParameters: TSTypeParameterDeclaration { type: "TSTypeParameterDeclaration", params: Array [ diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/5-AST-Alignment-AST.shot index ca63e23a86a..ba4db0136d7 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/5-AST-Alignment-AST.shot @@ -41,55 +41,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic-multiple }, }, - superTypeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'C', -- -- range: [108, 109], -- loc: { -- start: { column: 35, line: 3 }, -- end: { column: 36, line: 3 }, -- }, -- }, -- -- range: [108, 109], -- loc: { -- start: { column: 35, line: 3 }, -- end: { column: 36, line: 3 }, -- }, -- }, -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'D', -- -- range: [111, 112], -- loc: { -- start: { column: 38, line: 3 }, -- end: { column: 39, line: 3 }, -- }, -- }, -- -- range: [111, 112], -- loc: { -- start: { column: 38, line: 3 }, -- end: { column: 39, line: 3 }, -- }, -- }, -- ], -- -- range: [107, 113], -- loc: { -- start: { column: 34, line: 3 }, -- end: { column: 40, line: 3 }, -- }, -- }, - superTypeParameters: TSTypeParameterInstantiation { ++ superTypeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/1-TSESTree-AST.shot index 0eb56ff8f7a..e383b780989 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/1-TSESTree-AST.shot @@ -66,36 +66,6 @@ Program { end: { column: 27, line: 3 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "B", - - range: [98, 99], - loc: { - start: { column: 25, line: 3 }, - end: { column: 26, line: 3 }, - }, - }, - - range: [98, 99], - loc: { - start: { column: 25, line: 3 }, - end: { column: 26, line: 3 }, - }, - }, - ], - - range: [97, 100], - loc: { - start: { column: 24, line: 3 }, - end: { column: 27, line: 3 }, - }, - }, typeParameters: TSTypeParameterDeclaration { type: "TSTypeParameterDeclaration", params: Array [ diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/5-AST-Alignment-AST.shot index a97ace5c3c1..e953f542bed 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/5-AST-Alignment-AST.shot @@ -41,36 +41,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic AST Alig }, }, - superTypeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'B', -- -- range: [98, 99], -- loc: { -- start: { column: 25, line: 3 }, -- end: { column: 26, line: 3 }, -- }, -- }, -- -- range: [98, 99], -- loc: { -- start: { column: 25, line: 3 }, -- end: { column: 26, line: 3 }, -- }, -- }, -- ], -- -- range: [97, 100], -- loc: { -- start: { column: 24, line: 3 }, -- end: { column: 27, line: 3 }, -- }, -- }, - superTypeParameters: TSTypeParameterInstantiation { ++ superTypeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/1-TSESTree-AST.shot index 9912ba6bbcc..dcf40730ae2 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/1-TSESTree-AST.shot @@ -88,55 +88,6 @@ Program { end: { column: 30, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "S", - - range: [98, 99], - loc: { - start: { column: 25, line: 3 }, - end: { column: 26, line: 3 }, - }, - }, - - range: [98, 99], - loc: { - start: { column: 25, line: 3 }, - end: { column: 26, line: 3 }, - }, - }, - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "T", - - range: [101, 102], - loc: { - start: { column: 28, line: 3 }, - end: { column: 29, line: 3 }, - }, - }, - - range: [101, 102], - loc: { - start: { column: 28, line: 3 }, - end: { column: 29, line: 3 }, - }, - }, - ], - - range: [97, 103], - loc: { - start: { column: 24, line: 3 }, - end: { column: 30, line: 3 }, - }, - }, range: [94, 103], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/5-AST-Alignment-AST.shot index d85931ef054..571df5af080 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/5-AST-Alignment-AST.shot @@ -43,58 +43,10 @@ exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic-multi loc: { start: { column: 21, line: 3 }, end: { column: 24, line: 3 }, -- }, -- }, -- typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'S', -- -- range: [98, 99], -- loc: { -- start: { column: 25, line: 3 }, -- end: { column: 26, line: 3 }, -- }, -- }, -- -- range: [98, 99], -- loc: { -- start: { column: 25, line: 3 }, -- end: { column: 26, line: 3 }, -- }, -- }, -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'T', -- -- range: [101, 102], -- loc: { -- start: { column: 28, line: 3 }, -- end: { column: 29, line: 3 }, -- }, -- }, -- -- range: [101, 102], -- loc: { -- start: { column: 28, line: 3 }, -- end: { column: 29, line: 3 }, -- }, -- }, -- ], -- -- range: [97, 103], -- loc: { -- start: { column: 24, line: 3 }, -- end: { column: 30, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { +- typeArguments: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/1-TSESTree-AST.shot index 75d8c33614f..47bebefba3a 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/1-TSESTree-AST.shot @@ -69,36 +69,6 @@ Program { end: { column: 27, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "S", - - range: [98, 99], - loc: { - start: { column: 25, line: 3 }, - end: { column: 26, line: 3 }, - }, - }, - - range: [98, 99], - loc: { - start: { column: 25, line: 3 }, - end: { column: 26, line: 3 }, - }, - }, - ], - - range: [97, 100], - loc: { - start: { column: 24, line: 3 }, - end: { column: 27, line: 3 }, - }, - }, range: [94, 100], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/5-AST-Alignment-AST.shot index 2f3b5490a9d..0e3f6c27017 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/5-AST-Alignment-AST.shot @@ -43,39 +43,10 @@ exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic AST A loc: { start: { column: 21, line: 3 }, end: { column: 24, line: 3 }, -- }, -- }, -- typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'S', -- -- range: [98, 99], -- loc: { -- start: { column: 25, line: 3 }, -- end: { column: 26, line: 3 }, -- }, -- }, -- -- range: [98, 99], -- loc: { -- start: { column: 25, line: 3 }, -- end: { column: 26, line: 3 }, -- }, -- }, -- ], -- -- range: [97, 100], -- loc: { -- start: { column: 24, line: 3 }, -- end: { column: 27, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { +- typeArguments: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/1-TSESTree-AST.shot index 373d4e7bae5..7235ab55400 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/1-TSESTree-AST.shot @@ -116,36 +116,6 @@ Program { end: { column: 32, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "M", - - range: [106, 107], - loc: { - start: { column: 33, line: 3 }, - end: { column: 34, line: 3 }, - }, - }, - - range: [106, 107], - loc: { - start: { column: 33, line: 3 }, - end: { column: 34, line: 3 }, - }, - }, - ], - - range: [105, 108], - loc: { - start: { column: 32, line: 3 }, - end: { column: 35, line: 3 }, - }, - }, range: [94, 108], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/5-AST-Alignment-AST.shot index 1656c11934c..e2b36d54588 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/5-AST-Alignment-AST.shot @@ -81,46 +81,17 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin-reference AST Alig constraint: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'M', -- -- range: [106, 107], -- loc: { -- start: { column: 33, line: 3 }, -- end: { column: 34, line: 3 }, -- }, -- }, -- -- range: [106, 107], -- loc: { -- start: { column: 33, line: 3 }, -- end: { column: 34, line: 3 }, -- }, -- }, -- ], -- -- range: [105, 108], -- loc: { -- start: { column: 32, line: 3 }, -- end: { column: 35, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'Constructor', - - range: [94, 105], - loc: { - start: { column: 21, line: 3 }, - end: { column: 32, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Constructor', ++ ++ range: [94, 105], ++ loc: { ++ start: { column: 21, line: 3 }, ++ end: { column: 32, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -150,7 +121,17 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin-reference AST Alig end: { column: 35, line: 3 }, }, }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'Constructor', +- range: [94, 105], +- loc: { +- start: { column: 21, line: 3 }, +- end: { column: 32, line: 3 }, +- }, +- }, +- range: [94, 108], loc: { start: { column: 21, line: 3 }, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/1-TSESTree-AST.shot index 62bbd5a6d78..af694a2c03a 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/1-TSESTree-AST.shot @@ -147,27 +147,6 @@ Program { end: { column: 32, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeLiteral { - type: "TSTypeLiteral", - members: Array [], - - range: [106, 108], - loc: { - start: { column: 33, line: 3 }, - end: { column: 35, line: 3 }, - }, - }, - ], - - range: [105, 109], - loc: { - start: { column: 32, line: 3 }, - end: { column: 36, line: 3 }, - }, - }, range: [94, 109], loc: { @@ -297,26 +276,6 @@ Program { end: { column: 22, line: 7 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSAnyKeyword { - type: "TSAnyKeyword", - - range: [175, 178], - loc: { - start: { column: 18, line: 7 }, - end: { column: 21, line: 7 }, - }, - }, - ], - - range: [174, 179], - loc: { - start: { column: 17, line: 7 }, - end: { column: 22, line: 7 }, - }, - }, range: [173, 182], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/5-AST-Alignment-AST.shot index 6b48e3e25a5..9da848e193a 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/5-AST-Alignment-AST.shot @@ -121,37 +121,17 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS constraint: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeLiteral { -- type: 'TSTypeLiteral', -- members: Array [], -- -- range: [106, 108], -- loc: { -- start: { column: 33, line: 3 }, -- end: { column: 35, line: 3 }, -- }, -- }, -- ], -- -- range: [105, 109], -- loc: { -- start: { column: 32, line: 3 }, -- end: { column: 36, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'Constructor', - - range: [94, 105], - loc: { - start: { column: 21, line: 3 }, - end: { column: 32, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Constructor', ++ ++ range: [94, 105], ++ loc: { ++ start: { column: 21, line: 3 }, ++ end: { column: 32, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeLiteral { @@ -172,7 +152,17 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS end: { column: 36, line: 3 }, }, }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'Constructor', +- range: [94, 105], +- loc: { +- start: { column: 21, line: 3 }, +- end: { column: 32, line: 3 }, +- }, +- }, +- range: [94, 109], loc: { start: { column: 21, line: 3 }, @@ -285,26 +275,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS }, optional: false, - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSAnyKeyword { -- type: 'TSAnyKeyword', -- -- range: [175, 178], -- loc: { -- start: { column: 18, line: 7 }, -- end: { column: 21, line: 7 }, -- }, -- }, -- ], -- -- range: [174, 179], -- loc: { -- start: { column: 17, line: 7 }, -- end: { column: 22, line: 7 }, -- }, -- }, - typeParameters: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSAnyKeyword { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/1-TSESTree-AST.shot index 22ea837ae55..32fac2ebda6 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/1-TSESTree-AST.shot @@ -172,26 +172,6 @@ Program { end: { column: 16, line: 6 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSStringKeyword { - type: "TSStringKeyword", - - range: [145, 151], - loc: { - start: { column: 17, line: 6 }, - end: { column: 23, line: 6 }, - }, - }, - ], - - range: [144, 152], - loc: { - start: { column: 16, line: 6 }, - end: { column: 24, line: 6 }, - }, - }, range: [139, 152], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/5-AST-Alignment-AST.shot index 543bea7d175..e7c6b0513f4 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/5-AST-Alignment-AST.shot @@ -147,36 +147,17 @@ exports[`AST Fixtures legacy-fixtures basics function-with-types-assignation AST typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSStringKeyword { -- type: 'TSStringKeyword', -- -- range: [145, 151], -- loc: { -- start: { column: 17, line: 6 }, -- end: { column: 23, line: 6 }, -- }, -- }, -- ], -- -- range: [144, 152], -- loc: { -- start: { column: 16, line: 6 }, -- end: { column: 24, line: 6 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'Array', - - range: [139, 144], - loc: { - start: { column: 11, line: 6 }, - end: { column: 16, line: 6 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Array', ++ ++ range: [139, 144], ++ loc: { ++ start: { column: 11, line: 6 }, ++ end: { column: 16, line: 6 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSStringKeyword { @@ -194,6 +175,16 @@ exports[`AST Fixtures legacy-fixtures basics function-with-types-assignation AST loc: { start: { column: 16, line: 6 }, end: { column: 24, line: 6 }, +- }, +- }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'Array', +- +- range: [139, 144], +- loc: { +- start: { column: 11, line: 6 }, +- end: { column: 16, line: 6 }, }, }, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/1-TSESTree-AST.shot index ba51eeaf2bc..8f91816edeb 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/1-TSESTree-AST.shot @@ -59,36 +59,6 @@ Program { end: { column: 31, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "J", - - range: [102, 103], - loc: { - start: { column: 29, line: 3 }, - end: { column: 30, line: 3 }, - }, - }, - - range: [102, 103], - loc: { - start: { column: 29, line: 3 }, - end: { column: 30, line: 3 }, - }, - }, - ], - - range: [101, 104], - loc: { - start: { column: 28, line: 3 }, - end: { column: 31, line: 3 }, - }, - }, range: [98, 104], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/5-AST-Alignment-AST.shot index 8743d1a6baf..2114cc8d3d3 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/5-AST-Alignment-AST.shot @@ -36,36 +36,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-extends-type-paramet }, }, - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'J', -- -- range: [102, 103], -- loc: { -- start: { column: 29, line: 3 }, -- end: { column: 30, line: 3 }, -- }, -- }, -- -- range: [102, 103], -- loc: { -- start: { column: 29, line: 3 }, -- end: { column: 30, line: 3 }, -- }, -- }, -- ], -- -- range: [101, 104], -- loc: { -- start: { column: 28, line: 3 }, -- end: { column: 31, line: 3 }, -- }, -- }, - typeParameters: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/1-TSESTree-AST.shot index 7cc4d89ca0c..2b3200b0137 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/1-TSESTree-AST.shot @@ -56,26 +56,6 @@ Program { end: { column: 34, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSStringKeyword { - type: "TSStringKeyword", - - range: [108, 114], - loc: { - start: { column: 35, line: 3 }, - end: { column: 41, line: 3 }, - }, - }, - ], - - range: [107, 115], - loc: { - start: { column: 34, line: 3 }, - end: { column: 42, line: 3 }, - }, - }, range: [102, 115], loc: { @@ -101,76 +81,6 @@ Program { end: { column: 28, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeArguments: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSStringKeyword { - type: "TSStringKeyword", - - range: [108, 114], - loc: { - start: { column: 35, line: 3 }, - end: { column: 41, line: 3 }, - }, - }, - ], - - range: [107, 115], - loc: { - start: { column: 34, line: 3 }, - end: { column: 42, line: 3 }, - }, - }, - typeName: Identifier { - type: "Identifier", - name: "Array", - - range: [102, 107], - loc: { - start: { column: 29, line: 3 }, - end: { column: 34, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSStringKeyword { - type: "TSStringKeyword", - - range: [108, 114], - loc: { - start: { column: 35, line: 3 }, - end: { column: 41, line: 3 }, - }, - }, - ], - - range: [107, 115], - loc: { - start: { column: 34, line: 3 }, - end: { column: 42, line: 3 }, - }, - }, - - range: [102, 115], - loc: { - start: { column: 29, line: 3 }, - end: { column: 42, line: 3 }, - }, - }, - ], - - range: [101, 116], - loc: { - start: { column: 28, line: 3 }, - end: { column: 43, line: 3 }, - }, - }, range: [96, 116], loc: { @@ -196,176 +106,6 @@ Program { end: { column: 22, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeArguments: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeArguments: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSStringKeyword { - type: "TSStringKeyword", - - range: [108, 114], - loc: { - start: { column: 35, line: 3 }, - end: { column: 41, line: 3 }, - }, - }, - ], - - range: [107, 115], - loc: { - start: { column: 34, line: 3 }, - end: { column: 42, line: 3 }, - }, - }, - typeName: Identifier { - type: "Identifier", - name: "Array", - - range: [102, 107], - loc: { - start: { column: 29, line: 3 }, - end: { column: 34, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSStringKeyword { - type: "TSStringKeyword", - - range: [108, 114], - loc: { - start: { column: 35, line: 3 }, - end: { column: 41, line: 3 }, - }, - }, - ], - - range: [107, 115], - loc: { - start: { column: 34, line: 3 }, - end: { column: 42, line: 3 }, - }, - }, - - range: [102, 115], - loc: { - start: { column: 29, line: 3 }, - end: { column: 42, line: 3 }, - }, - }, - ], - - range: [101, 116], - loc: { - start: { column: 28, line: 3 }, - end: { column: 43, line: 3 }, - }, - }, - typeName: Identifier { - type: "Identifier", - name: "Array", - - range: [96, 101], - loc: { - start: { column: 23, line: 3 }, - end: { column: 28, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeArguments: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSStringKeyword { - type: "TSStringKeyword", - - range: [108, 114], - loc: { - start: { column: 35, line: 3 }, - end: { column: 41, line: 3 }, - }, - }, - ], - - range: [107, 115], - loc: { - start: { column: 34, line: 3 }, - end: { column: 42, line: 3 }, - }, - }, - typeName: Identifier { - type: "Identifier", - name: "Array", - - range: [102, 107], - loc: { - start: { column: 29, line: 3 }, - end: { column: 34, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSStringKeyword { - type: "TSStringKeyword", - - range: [108, 114], - loc: { - start: { column: 35, line: 3 }, - end: { column: 41, line: 3 }, - }, - }, - ], - - range: [107, 115], - loc: { - start: { column: 34, line: 3 }, - end: { column: 42, line: 3 }, - }, - }, - - range: [102, 115], - loc: { - start: { column: 29, line: 3 }, - end: { column: 42, line: 3 }, - }, - }, - ], - - range: [101, 116], - loc: { - start: { column: 28, line: 3 }, - end: { column: 43, line: 3 }, - }, - }, - - range: [96, 116], - loc: { - start: { column: 23, line: 3 }, - end: { column: 43, line: 3 }, - }, - }, - ], - - range: [95, 117], - loc: { - start: { column: 22, line: 3 }, - end: { column: 44, line: 3 }, - }, - }, range: [90, 117], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/5-AST-Alignment-AST.shot index 7813a45fd01..3ddffd0f15b 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/5-AST-Alignment-AST.shot @@ -21,306 +21,49 @@ exports[`AST Fixtures legacy-fixtures basics nested-type-arguments AST Alignment typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSStringKeyword { -- type: 'TSStringKeyword', -- -- range: [108, 114], -- loc: { -- start: { column: 35, line: 3 }, -- end: { column: 41, line: 3 }, -- }, -- }, -- ], -- -- range: [107, 115], -- loc: { -- start: { column: 34, line: 3 }, -- end: { column: 42, line: 3 }, -- }, -- }, -- typeName: Identifier { -- type: 'Identifier', -- name: 'Array', -- -- range: [102, 107], -- loc: { -- start: { column: 29, line: 3 }, -- end: { column: 34, line: 3 }, -- }, -- }, -- typeParameters: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSStringKeyword { -- type: 'TSStringKeyword', -- -- range: [108, 114], -- loc: { -- start: { column: 35, line: 3 }, -- end: { column: 41, line: 3 }, -- }, -- }, -- ], -- -- range: [107, 115], -- loc: { -- start: { column: 34, line: 3 }, -- end: { column: 42, line: 3 }, -- }, -- }, -- -- range: [102, 115], -- loc: { -- start: { column: 29, line: 3 }, -- end: { column: 42, line: 3 }, -- }, -- }, -- ], -- -- range: [101, 116], -- loc: { -- start: { column: 28, line: 3 }, -- end: { column: 43, line: 3 }, -- }, -- }, -- typeName: Identifier { -- type: 'Identifier', -- name: 'Array', -- -- range: [96, 101], -- loc: { -- start: { column: 23, line: 3 }, -- end: { column: 28, line: 3 }, -- }, -- }, -- typeParameters: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSStringKeyword { -- type: 'TSStringKeyword', -- -- range: [108, 114], -- loc: { -- start: { column: 35, line: 3 }, -- end: { column: 41, line: 3 }, -- }, -- }, -- ], -- -- range: [107, 115], -- loc: { -- start: { column: 34, line: 3 }, -- end: { column: 42, line: 3 }, -- }, -- }, -- typeName: Identifier { -- type: 'Identifier', -- name: 'Array', -- -- range: [102, 107], -- loc: { -- start: { column: 29, line: 3 }, -- end: { column: 34, line: 3 }, -- }, -- }, -- typeParameters: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSStringKeyword { -- type: 'TSStringKeyword', -- -- range: [108, 114], -- loc: { -- start: { column: 35, line: 3 }, -- end: { column: 41, line: 3 }, -- }, -- }, -- ], -- -- range: [107, 115], -- loc: { -- start: { column: 34, line: 3 }, -- end: { column: 42, line: 3 }, -- }, -- }, -- -- range: [102, 115], -- loc: { -- start: { column: 29, line: 3 }, -- end: { column: 42, line: 3 }, -- }, -- }, -- ], -- -- range: [101, 116], -- loc: { -- start: { column: 28, line: 3 }, -- end: { column: 43, line: 3 }, -- }, -- }, -- -- range: [96, 116], -- loc: { -- start: { column: 23, line: 3 }, -- end: { column: 43, line: 3 }, -- }, -- }, -- ], -- -- range: [95, 117], -- loc: { -- start: { column: 22, line: 3 }, -- end: { column: 44, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'Array', - - range: [90, 95], - loc: { - start: { column: 17, line: 3 }, - end: { column: 22, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Array', ++ ++ range: [90, 95], ++ loc: { ++ start: { column: 17, line: 3 }, ++ end: { column: 22, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSStringKeyword { -- type: 'TSStringKeyword', -- -- range: [108, 114], -- loc: { -- start: { column: 35, line: 3 }, -- end: { column: 41, line: 3 }, -- }, -- }, -- ], -- -- range: [107, 115], -- loc: { -- start: { column: 34, line: 3 }, -- end: { column: 42, line: 3 }, -- }, -- }, -- typeName: Identifier { -- type: 'Identifier', -- name: 'Array', -- -- range: [102, 107], -- loc: { -- start: { column: 29, line: 3 }, -- end: { column: 34, line: 3 }, -- }, -- }, -- typeParameters: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSStringKeyword { -- type: 'TSStringKeyword', -- -- range: [108, 114], -- loc: { -- start: { column: 35, line: 3 }, -- end: { column: 41, line: 3 }, -- }, -- }, -- ], -- -- range: [107, 115], -- loc: { -- start: { column: 34, line: 3 }, -- end: { column: 42, line: 3 }, -- }, -- }, -- -- range: [102, 115], -- loc: { -- start: { column: 29, line: 3 }, -- end: { column: 42, line: 3 }, -- }, -- }, -- ], -- -- range: [101, 116], -- loc: { -- start: { column: 28, line: 3 }, -- end: { column: 43, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'Array', - - range: [96, 101], - loc: { - start: { column: 23, line: 3 }, - end: { column: 28, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Array', ++ ++ range: [96, 101], ++ loc: { ++ start: { column: 23, line: 3 }, ++ end: { column: 28, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSStringKeyword { -- type: 'TSStringKeyword', -- -- range: [108, 114], -- loc: { -- start: { column: 35, line: 3 }, -- end: { column: 41, line: 3 }, -- }, -- }, -- ], -- -- range: [107, 115], -- loc: { -- start: { column: 34, line: 3 }, -- end: { column: 42, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'Array', - - range: [102, 107], - loc: { - start: { column: 29, line: 3 }, - end: { column: 34, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Array', ++ ++ range: [102, 107], ++ loc: { ++ start: { column: 29, line: 3 }, ++ end: { column: 34, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSStringKeyword { @@ -338,6 +81,16 @@ exports[`AST Fixtures legacy-fixtures basics nested-type-arguments AST Alignment loc: { start: { column: 34, line: 3 }, end: { column: 42, line: 3 }, +- }, +- }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'Array', +- +- range: [102, 107], +- loc: { +- start: { column: 29, line: 3 }, +- end: { column: 34, line: 3 }, }, }, @@ -353,6 +106,16 @@ exports[`AST Fixtures legacy-fixtures basics nested-type-arguments AST Alignment loc: { start: { column: 28, line: 3 }, end: { column: 43, line: 3 }, +- }, +- }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'Array', +- +- range: [96, 101], +- loc: { +- start: { column: 23, line: 3 }, +- end: { column: 28, line: 3 }, }, }, @@ -368,6 +131,16 @@ exports[`AST Fixtures legacy-fixtures basics nested-type-arguments AST Alignment loc: { start: { column: 22, line: 3 }, end: { column: 44, line: 3 }, +- }, +- }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'Array', +- +- range: [90, 95], +- loc: { +- start: { column: 17, line: 3 }, +- end: { column: 22, line: 3 }, }, }, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/1-TSESTree-AST.shot index 97820a6e6d8..80f127297b9 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/1-TSESTree-AST.shot @@ -46,26 +46,6 @@ Program { end: { column: 8, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSNeverKeyword { - type: "TSNeverKeyword", - - range: [82, 87], - loc: { - start: { column: 9, line: 3 }, - end: { column: 14, line: 3 }, - }, - }, - ], - - range: [81, 88], - loc: { - start: { column: 8, line: 3 }, - end: { column: 15, line: 3 }, - }, - }, range: [80, 88], loc: { @@ -161,26 +141,6 @@ Program { end: { column: 23, line: 4 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSNeverKeyword { - type: "TSNeverKeyword", - - range: [107, 112], - loc: { - start: { column: 17, line: 4 }, - end: { column: 22, line: 4 }, - }, - }, - ], - - range: [106, 113], - loc: { - start: { column: 16, line: 4 }, - end: { column: 23, line: 4 }, - }, - }, range: [90, 115], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/5-AST-Alignment-AST.shot index 718e34a1d42..69f5b1420ee 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/5-AST-Alignment-AST.shot @@ -21,36 +21,17 @@ exports[`AST Fixtures legacy-fixtures basics never-type-param AST Alignment - AS typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSNeverKeyword { -- type: 'TSNeverKeyword', -- -- range: [82, 87], -- loc: { -- start: { column: 9, line: 3 }, -- end: { column: 14, line: 3 }, -- }, -- }, -- ], -- -- range: [81, 88], -- loc: { -- start: { column: 8, line: 3 }, -- end: { column: 15, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'X', - - range: [80, 81], - loc: { - start: { column: 7, line: 3 }, - end: { column: 8, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'X', ++ ++ range: [80, 81], ++ loc: { ++ start: { column: 7, line: 3 }, ++ end: { column: 8, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSNeverKeyword { @@ -68,6 +49,16 @@ exports[`AST Fixtures legacy-fixtures basics never-type-param AST Alignment - AS loc: { start: { column: 8, line: 3 }, end: { column: 15, line: 3 }, +- }, +- }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'X', +- +- range: [80, 81], +- loc: { +- start: { column: 7, line: 3 }, +- end: { column: 8, line: 3 }, }, }, @@ -146,26 +137,7 @@ exports[`AST Fixtures legacy-fixtures basics never-type-param AST Alignment - AS }, optional: false, - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSNeverKeyword { -- type: 'TSNeverKeyword', -- -- range: [107, 112], -- loc: { -- start: { column: 17, line: 4 }, -- end: { column: 22, line: 4 }, -- }, -- }, -- ], -- -- range: [106, 113], -- loc: { -- start: { column: 16, line: 4 }, -- end: { column: 23, line: 4 }, -- }, -- }, - typeParameters: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSNeverKeyword { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/1-TSESTree-AST.shot index d0e7554b413..05c52034f33 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/1-TSESTree-AST.shot @@ -182,26 +182,6 @@ Program { end: { column: 31, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSStringKeyword { - type: "TSStringKeyword", - - range: [105, 111], - loc: { - start: { column: 32, line: 3 }, - end: { column: 38, line: 3 }, - }, - }, - ], - - range: [104, 112], - loc: { - start: { column: 31, line: 3 }, - end: { column: 39, line: 3 }, - }, - }, range: [91, 112], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/5-AST-Alignment-AST.shot index 398454beb2d..5707e2c9883 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/5-AST-Alignment-AST.shot @@ -157,36 +157,17 @@ exports[`AST Fixtures legacy-fixtures basics readonly-arrays AST Alignment - AST typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSStringKeyword { -- type: 'TSStringKeyword', -- -- range: [105, 111], -- loc: { -- start: { column: 32, line: 3 }, -- end: { column: 38, line: 3 }, -- }, -- }, -- ], -- -- range: [104, 112], -- loc: { -- start: { column: 31, line: 3 }, -- end: { column: 39, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'ReadonlyArray', - - range: [91, 104], - loc: { - start: { column: 18, line: 3 }, - end: { column: 31, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'ReadonlyArray', ++ ++ range: [91, 104], ++ loc: { ++ start: { column: 18, line: 3 }, ++ end: { column: 31, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSStringKeyword { @@ -204,6 +185,16 @@ exports[`AST Fixtures legacy-fixtures basics readonly-arrays AST Alignment - AST loc: { start: { column: 31, line: 3 }, end: { column: 39, line: 3 }, +- }, +- }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'ReadonlyArray', +- +- range: [91, 104], +- loc: { +- start: { column: 18, line: 3 }, +- end: { column: 31, line: 3 }, }, }, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/1-TSESTree-AST.shot index b9b06647269..f7e0ff55d34 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/1-TSESTree-AST.shot @@ -76,35 +76,6 @@ Program { end: { column: 22, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSSymbolKeyword { - type: "TSSymbolKeyword", - - range: [96, 102], - loc: { - start: { column: 23, line: 3 }, - end: { column: 29, line: 3 }, - }, - }, - TSStringKeyword { - type: "TSStringKeyword", - - range: [104, 110], - loc: { - start: { column: 31, line: 3 }, - end: { column: 37, line: 3 }, - }, - }, - ], - - range: [95, 111], - loc: { - start: { column: 22, line: 3 }, - end: { column: 38, line: 3 }, - }, - }, range: [92, 111], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/5-AST-Alignment-AST.shot index 05b325e0ad0..40ec3100c04 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/5-AST-Alignment-AST.shot @@ -42,45 +42,17 @@ exports[`AST Fixtures legacy-fixtures basics symbol-type-param AST Alignment - A typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSSymbolKeyword { -- type: 'TSSymbolKeyword', -- -- range: [96, 102], -- loc: { -- start: { column: 23, line: 3 }, -- end: { column: 29, line: 3 }, -- }, -- }, -- TSStringKeyword { -- type: 'TSStringKeyword', -- -- range: [104, 110], -- loc: { -- start: { column: 31, line: 3 }, -- end: { column: 37, line: 3 }, -- }, -- }, -- ], -- -- range: [95, 111], -- loc: { -- start: { column: 22, line: 3 }, -- end: { column: 38, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'Map', - - range: [92, 95], - loc: { - start: { column: 19, line: 3 }, - end: { column: 22, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Map', ++ ++ range: [92, 95], ++ loc: { ++ start: { column: 19, line: 3 }, ++ end: { column: 22, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSSymbolKeyword { @@ -107,6 +79,16 @@ exports[`AST Fixtures legacy-fixtures basics symbol-type-param AST Alignment - A loc: { start: { column: 22, line: 3 }, end: { column: 38, line: 3 }, +- }, +- }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'Map', +- +- range: [92, 95], +- loc: { +- start: { column: 19, line: 3 }, +- end: { column: 22, line: 3 }, }, }, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/1-TSESTree-AST.shot index 3ef2c4b3537..791f9f0f3d1 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/1-TSESTree-AST.shot @@ -61,36 +61,6 @@ Program { end: { column: 35, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "T", - - range: [109, 110], - loc: { - start: { column: 36, line: 3 }, - end: { column: 37, line: 3 }, - }, - }, - - range: [109, 110], - loc: { - start: { column: 36, line: 3 }, - end: { column: 37, line: 3 }, - }, - }, - ], - - range: [108, 111], - loc: { - start: { column: 35, line: 3 }, - end: { column: 38, line: 3 }, - }, - }, range: [101, 111], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/5-AST-Alignment-AST.shot index 168056ecf87..c0e7eef9c93 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/5-AST-Alignment-AST.shot @@ -26,46 +26,17 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-with-constra TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'T', -- -- range: [109, 110], -- loc: { -- start: { column: 36, line: 3 }, -- end: { column: 37, line: 3 }, -- }, -- }, -- -- range: [109, 110], -- loc: { -- start: { column: 36, line: 3 }, -- end: { column: 37, line: 3 }, -- }, -- }, -- ], -- -- range: [108, 111], -- loc: { -- start: { column: 35, line: 3 }, -- end: { column: 38, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'Success', - - range: [101, 108], - loc: { - start: { column: 28, line: 3 }, - end: { column: 35, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Success', ++ ++ range: [101, 108], ++ loc: { ++ start: { column: 28, line: 3 }, ++ end: { column: 35, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -95,7 +66,17 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-with-constra end: { column: 38, line: 3 }, }, }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'Success', +- range: [101, 108], +- loc: { +- start: { column: 28, line: 3 }, +- end: { column: 35, line: 3 }, +- }, +- }, +- range: [101, 111], loc: { start: { column: 28, line: 3 }, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/1-TSESTree-AST.shot index 34a40d3d5f7..3cdf1b18673 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/1-TSESTree-AST.shot @@ -61,36 +61,6 @@ Program { end: { column: 24, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "T", - - range: [98, 99], - loc: { - start: { column: 25, line: 3 }, - end: { column: 26, line: 3 }, - }, - }, - - range: [98, 99], - loc: { - start: { column: 25, line: 3 }, - end: { column: 26, line: 3 }, - }, - }, - ], - - range: [97, 100], - loc: { - start: { column: 24, line: 3 }, - end: { column: 27, line: 3 }, - }, - }, range: [90, 100], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/5-AST-Alignment-AST.shot index 6e0d8613180..b01111ff543 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/5-AST-Alignment-AST.shot @@ -26,46 +26,17 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration AST Alignmen TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'T', -- -- range: [98, 99], -- loc: { -- start: { column: 25, line: 3 }, -- end: { column: 26, line: 3 }, -- }, -- }, -- -- range: [98, 99], -- loc: { -- start: { column: 25, line: 3 }, -- end: { column: 26, line: 3 }, -- }, -- }, -- ], -- -- range: [97, 100], -- loc: { -- start: { column: 24, line: 3 }, -- end: { column: 27, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'Success', - - range: [90, 97], - loc: { - start: { column: 17, line: 3 }, - end: { column: 24, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Success', ++ ++ range: [90, 97], ++ loc: { ++ start: { column: 17, line: 3 }, ++ end: { column: 24, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -95,7 +66,17 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration AST Alignmen end: { column: 27, line: 3 }, }, }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'Success', +- range: [90, 97], +- loc: { +- start: { column: 17, line: 3 }, +- end: { column: 24, line: 3 }, +- }, +- }, +- range: [90, 100], loc: { start: { column: 17, line: 3 }, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/1-TSESTree-AST.shot index 4e35addc8df..ecd91ed23c5 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/1-TSESTree-AST.shot @@ -118,96 +118,6 @@ Program { end: { column: 10, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSImportType { - type: "TSImportType", - argument: TSLiteralType { - type: "TSLiteralType", - literal: Literal { - type: "Literal", - raw: "''", - value: "", - - range: [91, 93], - loc: { - start: { column: 18, line: 3 }, - end: { column: 20, line: 3 }, - }, - }, - - range: [91, 93], - loc: { - start: { column: 18, line: 3 }, - end: { column: 20, line: 3 }, - }, - }, - qualifier: Identifier { - type: "Identifier", - name: "B", - - range: [95, 96], - loc: { - start: { column: 22, line: 3 }, - end: { column: 23, line: 3 }, - }, - }, - typeArguments: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSAnyKeyword { - type: "TSAnyKeyword", - - range: [97, 100], - loc: { - start: { column: 24, line: 3 }, - end: { column: 27, line: 3 }, - }, - }, - ], - - range: [96, 101], - loc: { - start: { column: 23, line: 3 }, - end: { column: 28, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSAnyKeyword { - type: "TSAnyKeyword", - - range: [97, 100], - loc: { - start: { column: 24, line: 3 }, - end: { column: 27, line: 3 }, - }, - }, - ], - - range: [96, 101], - loc: { - start: { column: 23, line: 3 }, - end: { column: 28, line: 3 }, - }, - }, - - range: [84, 101], - loc: { - start: { column: 11, line: 3 }, - end: { column: 28, line: 3 }, - }, - }, - ], - - range: [83, 102], - loc: { - start: { column: 10, line: 3 }, - end: { column: 29, line: 3 }, - }, - }, range: [82, 102], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/5-AST-Alignment-AST.shot index 3d2a86f859c..d7ebe47a9bd 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/5-AST-Alignment-AST.shot @@ -23,106 +23,17 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type-with-type-paramete typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSImportType { -- type: 'TSImportType', -- argument: TSLiteralType { -- type: 'TSLiteralType', -- literal: Literal { -- type: 'Literal', -- raw: '\\\\'\\\\'', -- value: '', -- -- range: [91, 93], -- loc: { -- start: { column: 18, line: 3 }, -- end: { column: 20, line: 3 }, -- }, -- }, -- -- range: [91, 93], -- loc: { -- start: { column: 18, line: 3 }, -- end: { column: 20, line: 3 }, -- }, -- }, -- qualifier: Identifier { -- type: 'Identifier', -- name: 'B', -- -- range: [95, 96], -- loc: { -- start: { column: 22, line: 3 }, -- end: { column: 23, line: 3 }, -- }, -- }, -- typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSAnyKeyword { -- type: 'TSAnyKeyword', -- -- range: [97, 100], -- loc: { -- start: { column: 24, line: 3 }, -- end: { column: 27, line: 3 }, -- }, -- }, -- ], -- -- range: [96, 101], -- loc: { -- start: { column: 23, line: 3 }, -- end: { column: 28, line: 3 }, -- }, -- }, -- typeParameters: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSAnyKeyword { -- type: 'TSAnyKeyword', -- -- range: [97, 100], -- loc: { -- start: { column: 24, line: 3 }, -- end: { column: 27, line: 3 }, -- }, -- }, -- ], -- -- range: [96, 101], -- loc: { -- start: { column: 23, line: 3 }, -- end: { column: 28, line: 3 }, -- }, -- }, -- -- range: [84, 101], -- loc: { -- start: { column: 11, line: 3 }, -- end: { column: 28, line: 3 }, -- }, -- }, -- ], -- -- range: [83, 102], -- loc: { -- start: { column: 10, line: 3 }, -- end: { column: 29, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'A', - - range: [82, 83], - loc: { - start: { column: 9, line: 3 }, - end: { column: 10, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'A', ++ ++ range: [82, 83], ++ loc: { ++ start: { column: 9, line: 3 }, ++ end: { column: 10, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSImportType { @@ -159,8 +70,8 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type-with-type-paramete loc: { start: { column: 22, line: 3 }, end: { column: 23, line: 3 }, -- }, -- }, + }, + }, - typeArguments: TSTypeParameterInstantiation { - type: 'TSTypeParameterInstantiation', - params: Array [ @@ -179,8 +90,8 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type-with-type-paramete - loc: { - start: { column: 23, line: 3 }, - end: { column: 28, line: 3 }, - }, - }, +- }, +- }, typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ @@ -214,6 +125,16 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type-with-type-paramete loc: { start: { column: 10, line: 3 }, end: { column: 29, line: 3 }, +- }, +- }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'A', +- +- range: [82, 83], +- loc: { +- start: { column: 9, line: 3 }, +- end: { column: 10, line: 3 }, }, }, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/1-TSESTree-AST.shot index 94eed9630d2..9716e7b1536 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/1-TSESTree-AST.shot @@ -66,36 +66,6 @@ Program { end: { column: 67, line: 3 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "A", - - range: [128, 129], - loc: { - start: { column: 55, line: 3 }, - end: { column: 56, line: 3 }, - }, - }, - - range: [128, 129], - loc: { - start: { column: 55, line: 3 }, - end: { column: 56, line: 3 }, - }, - }, - ], - - range: [117, 140], - loc: { - start: { column: 44, line: 3 }, - end: { column: 67, line: 3 }, - }, - }, typeParameters: TSTypeParameterDeclaration { type: "TSTypeParameterDeclaration", params: Array [ @@ -197,36 +167,6 @@ Program { end: { column: 36, line: 6 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "A", - - range: [219, 220], - loc: { - start: { column: 24, line: 6 }, - end: { column: 25, line: 6 }, - }, - }, - - range: [219, 220], - loc: { - start: { column: 24, line: 6 }, - end: { column: 25, line: 6 }, - }, - }, - ], - - range: [208, 231], - loc: { - start: { column: 13, line: 6 }, - end: { column: 36, line: 6 }, - }, - }, typeParameters: TSTypeParameterDeclaration { type: "TSTypeParameterDeclaration", params: Array [ @@ -341,36 +281,6 @@ Program { end: { column: 72, line: 7 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "A", - - range: [295, 296], - loc: { - start: { column: 60, line: 7 }, - end: { column: 61, line: 7 }, - }, - }, - - range: [295, 296], - loc: { - start: { column: 60, line: 7 }, - end: { column: 61, line: 7 }, - }, - }, - ], - - range: [284, 307], - loc: { - start: { column: 49, line: 7 }, - end: { column: 72, line: 7 }, - }, - }, range: [280, 307], loc: { @@ -483,36 +393,6 @@ Program { end: { column: 36, line: 9 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "A", - - range: [387, 388], - loc: { - start: { column: 24, line: 9 }, - end: { column: 25, line: 9 }, - }, - }, - - range: [387, 388], - loc: { - start: { column: 24, line: 9 }, - end: { column: 25, line: 9 }, - }, - }, - ], - - range: [376, 399], - loc: { - start: { column: 13, line: 9 }, - end: { column: 36, line: 9 }, - }, - }, range: [373, 399], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/5-AST-Alignment-AST.shot index 61551b391db..4eddd8eb72b 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/5-AST-Alignment-AST.shot @@ -41,36 +41,7 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A }, }, - superTypeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'A', -- -- range: [128, 129], -- loc: { -- start: { column: 55, line: 3 }, -- end: { column: 56, line: 3 }, -- }, -- }, -- -- range: [128, 129], -- loc: { -- start: { column: 55, line: 3 }, -- end: { column: 56, line: 3 }, -- }, -- }, -- ], -- -- range: [117, 140], -- loc: { -- start: { column: 44, line: 3 }, -- end: { column: 67, line: 3 }, -- }, -- }, - superTypeParameters: TSTypeParameterInstantiation { ++ superTypeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -109,8 +80,7 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A - name: Identifier { - type: 'Identifier', - name: 'A', -+ name: 'A', - +- - range: [93, 94], - loc: { - start: { column: 20, line: 3 }, @@ -118,7 +88,8 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A - }, - }, - out: false, -- ++ name: 'A', + range: [93, 94], loc: { start: { column: 20, line: 3 }, @@ -170,39 +141,10 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A loc: { start: { column: 10, line: 6 }, end: { column: 13, line: 6 }, -- }, -- }, -- superTypeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'A', -- -- range: [219, 220], -- loc: { -- start: { column: 24, line: 6 }, -- end: { column: 25, line: 6 }, -- }, -- }, -- -- range: [219, 220], -- loc: { -- start: { column: 24, line: 6 }, -- end: { column: 25, line: 6 }, -- }, -- }, -- ], -- -- range: [208, 231], -- loc: { -- start: { column: 13, line: 6 }, -- end: { column: 36, line: 6 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { +- superTypeArguments: TSTypeParameterInstantiation { ++ superTypeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -255,8 +197,8 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A loc: { start: { column: 26, line: 5 }, end: { column: 27, line: 5 }, - }, - }, +- }, +- }, - in: false, - name: Identifier { - type: 'Identifier', @@ -266,8 +208,8 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A - loc: { - start: { column: 12, line: 5 }, - end: { column: 13, line: 5 }, -- }, -- }, + }, + }, - out: false, + name: 'A', @@ -317,39 +259,10 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A loc: { start: { column: 45, line: 7 }, end: { column: 49, line: 7 }, -- }, -- }, -- typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'A', -- -- range: [295, 296], -- loc: { -- start: { column: 60, line: 7 }, -- end: { column: 61, line: 7 }, -- }, -- }, -- -- range: [295, 296], -- loc: { -- start: { column: 60, line: 7 }, -- end: { column: 61, line: 7 }, -- }, -- }, -- ], -- -- range: [284, 307], -- loc: { -- start: { column: 49, line: 7 }, -- end: { column: 72, line: 7 }, }, }, - typeParameters: TSTypeParameterInstantiation { +- typeArguments: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -462,39 +375,10 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A loc: { start: { column: 10, line: 9 }, end: { column: 13, line: 9 }, -- }, -- }, -- typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'A', -- -- range: [387, 388], -- loc: { -- start: { column: 24, line: 9 }, -- end: { column: 25, line: 9 }, -- }, -- }, -- -- range: [387, 388], -- loc: { -- start: { column: 24, line: 9 }, -- end: { column: 25, line: 9 }, -- }, -- }, -- ], -- -- range: [376, 399], -- loc: { -- start: { column: 13, line: 9 }, -- end: { column: 36, line: 9 }, }, }, - typeParameters: TSTypeParameterInstantiation { +- typeArguments: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/1-TSESTree-AST.shot index 19505507e6e..89734d6a5d7 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/1-TSESTree-AST.shot @@ -50,36 +50,6 @@ Program { end: { column: 38, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "A", - - range: [93, 94], - loc: { - start: { column: 20, line: 3 }, - end: { column: 21, line: 3 }, - }, - }, - - range: [93, 94], - loc: { - start: { column: 20, line: 3 }, - end: { column: 21, line: 3 }, - }, - }, - ], - - range: [76, 111], - loc: { - start: { column: 3, line: 3 }, - end: { column: 38, line: 3 }, - }, - }, range: [73, 113], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/5-AST-Alignment-AST.shot index dfa3331ca0d..6753b1231a9 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/5-AST-Alignment-AST.shot @@ -25,36 +25,7 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments AST Alignm }, optional: false, - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'A', -- -- range: [93, 94], -- loc: { -- start: { column: 20, line: 3 }, -- end: { column: 21, line: 3 }, -- }, -- }, -- -- range: [93, 94], -- loc: { -- start: { column: 20, line: 3 }, -- end: { column: 21, line: 3 }, -- }, -- }, -- ], -- -- range: [76, 111], -- loc: { -- start: { column: 3, line: 3 }, -- end: { column: 38, line: 3 }, -- }, -- }, - typeParameters: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -133,8 +104,7 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments AST Alignm - name: Identifier { - type: 'Identifier', - name: 'A', -+ name: 'A', - +- - range: [138, 139], - loc: { - start: { column: 23, line: 4 }, @@ -142,7 +112,8 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments AST Alignm - }, - }, - out: false, -- ++ name: 'A', + range: [138, 139], loc: { start: { column: 23, line: 4 }, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/1-TSESTree-AST.shot index 75dbf16b8c1..e33afb57cf9 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/1-TSESTree-AST.shot @@ -78,26 +78,6 @@ Program { end: { column: 29, line: 4 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSAnyKeyword { - type: "TSAnyKeyword", - - range: [127, 130], - loc: { - start: { column: 30, line: 4 }, - end: { column: 33, line: 4 }, - }, - }, - ], - - range: [126, 147], - loc: { - start: { column: 29, line: 4 }, - end: { column: 50, line: 4 }, - }, - }, range: [109, 147], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/5-AST-Alignment-AST.shot index 3d1129c5acf..dee6e4bbe42 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/5-AST-Alignment-AST.shot @@ -80,26 +80,26 @@ exports[`AST Fixtures legacy-fixtures basics type-reference-comments AST Alignme loc: { start: { column: 12, line: 4 }, end: { column: 29, line: 4 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { - type: 'TSTypeParameterInstantiation', - params: Array [ - TSAnyKeyword { - type: 'TSAnyKeyword', - - range: [127, 130], - loc: { - start: { column: 30, line: 4 }, - end: { column: 33, line: 4 }, - }, - }, - ], - - range: [126, 147], - loc: { - start: { column: 29, line: 4 }, - end: { column: 50, line: 4 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { ++ type: 'TSTypeParameterInstantiation', ++ params: Array [ ++ TSAnyKeyword { ++ type: 'TSAnyKeyword', ++ ++ range: [127, 130], ++ loc: { ++ start: { column: 30, line: 4 }, ++ end: { column: 33, line: 4 }, ++ }, ++ }, ++ ], ++ ++ range: [126, 147], ++ loc: { ++ start: { column: 29, line: 4 }, ++ end: { column: 50, line: 4 }, }, }, diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/1-TSESTree-AST.shot index 1b469748f96..68779b7e433 100644 --- a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/1-TSESTree-AST.shot @@ -50,36 +50,6 @@ Program { end: { column: 6, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "A", - - range: [77, 78], - loc: { - start: { column: 4, line: 3 }, - end: { column: 5, line: 3 }, - }, - }, - - range: [77, 78], - loc: { - start: { column: 4, line: 3 }, - end: { column: 5, line: 3 }, - }, - }, - ], - - range: [76, 79], - loc: { - start: { column: 3, line: 3 }, - end: { column: 6, line: 3 }, - }, - }, range: [73, 81], loc: { @@ -130,26 +100,6 @@ Program { end: { column: 11, line: 4 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSNumberKeyword { - type: "TSNumberKeyword", - - range: [87, 93], - loc: { - start: { column: 4, line: 4 }, - end: { column: 10, line: 4 }, - }, - }, - ], - - range: [86, 94], - loc: { - start: { column: 3, line: 4 }, - end: { column: 11, line: 4 }, - }, - }, range: [83, 96], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot index 967a42b4d8d..3837b30fd4f 100644 --- a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot @@ -25,36 +25,7 @@ exports[`AST Fixtures legacy-fixtures expressions call-expression-type-arguments }, optional: false, - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'A', -- -- range: [77, 78], -- loc: { -- start: { column: 4, line: 3 }, -- end: { column: 5, line: 3 }, -- }, -- }, -- -- range: [77, 78], -- loc: { -- start: { column: 4, line: 3 }, -- end: { column: 5, line: 3 }, -- }, -- }, -- ], -- -- range: [76, 79], -- loc: { -- start: { column: 3, line: 3 }, -- end: { column: 6, line: 3 }, -- }, -- }, - typeParameters: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -115,26 +86,7 @@ exports[`AST Fixtures legacy-fixtures expressions call-expression-type-arguments }, optional: false, - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSNumberKeyword { -- type: 'TSNumberKeyword', -- -- range: [87, 93], -- loc: { -- start: { column: 4, line: 4 }, -- end: { column: 10, line: 4 }, -- }, -- }, -- ], -- -- range: [86, 94], -- loc: { -- start: { column: 3, line: 4 }, -- end: { column: 11, line: 4 }, -- }, -- }, - typeParameters: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSNumberKeyword { diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/1-TSESTree-AST.shot index 67168f76a86..be210555378 100644 --- a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/1-TSESTree-AST.shot @@ -73,36 +73,6 @@ Program { end: { column: 11, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "A", - - range: [82, 83], - loc: { - start: { column: 9, line: 3 }, - end: { column: 10, line: 3 }, - }, - }, - - range: [82, 83], - loc: { - start: { column: 9, line: 3 }, - end: { column: 10, line: 3 }, - }, - }, - ], - - range: [81, 84], - loc: { - start: { column: 8, line: 3 }, - end: { column: 11, line: 3 }, - }, - }, range: [73, 86], loc: { @@ -183,26 +153,6 @@ Program { end: { column: 16, line: 4 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSNumberKeyword { - type: "TSNumberKeyword", - - range: [97, 103], - loc: { - start: { column: 9, line: 4 }, - end: { column: 15, line: 4 }, - }, - }, - ], - - range: [96, 104], - loc: { - start: { column: 8, line: 4 }, - end: { column: 16, line: 4 }, - }, - }, range: [88, 106], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot index 562cb823f8f..447f8d2e801 100644 --- a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot @@ -48,36 +48,7 @@ exports[`AST Fixtures legacy-fixtures expressions optional-call-expression-type- }, optional: false, - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'A', -- -- range: [82, 83], -- loc: { -- start: { column: 9, line: 3 }, -- end: { column: 10, line: 3 }, -- }, -- }, -- -- range: [82, 83], -- loc: { -- start: { column: 9, line: 3 }, -- end: { column: 10, line: 3 }, -- }, -- }, -- ], -- -- range: [81, 84], -- loc: { -- start: { column: 8, line: 3 }, -- end: { column: 11, line: 3 }, -- }, -- }, - typeParameters: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -168,26 +139,7 @@ exports[`AST Fixtures legacy-fixtures expressions optional-call-expression-type- }, optional: false, - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSNumberKeyword { -- type: 'TSNumberKeyword', -- -- range: [97, 103], -- loc: { -- start: { column: 9, line: 4 }, -- end: { column: 15, line: 4 }, -- }, -- }, -- ], -- -- range: [96, 104], -- loc: { -- start: { column: 8, line: 4 }, -- end: { column: 16, line: 4 }, -- }, -- }, - typeParameters: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSNumberKeyword { diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/1-TSESTree-AST.shot index 737bf26abde..70a97640656 100644 --- a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/1-TSESTree-AST.shot @@ -74,36 +74,6 @@ Program { end: { column: 8, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "bar", - - range: [77, 80], - loc: { - start: { column: 4, line: 3 }, - end: { column: 7, line: 3 }, - }, - }, - - range: [77, 80], - loc: { - start: { column: 4, line: 3 }, - end: { column: 7, line: 3 }, - }, - }, - ], - - range: [76, 81], - loc: { - start: { column: 3, line: 3 }, - end: { column: 8, line: 3 }, - }, - }, range: [73, 86], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot index b36c5b7cb86..2060aea5bc1 100644 --- a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot @@ -49,36 +49,7 @@ exports[`AST Fixtures legacy-fixtures expressions tagged-template-expression-typ }, }, - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'bar', -- -- range: [77, 80], -- loc: { -- start: { column: 4, line: 3 }, -- end: { column: 7, line: 3 }, -- }, -- }, -- -- range: [77, 80], -- loc: { -- start: { column: 4, line: 3 }, -- end: { column: 7, line: 3 }, -- }, -- }, -- ], -- -- range: [76, 81], -- loc: { -- start: { column: 3, line: 3 }, -- end: { column: 8, line: 3 }, -- }, -- }, - typeParameters: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { 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 eaf0d5dcc37..2d098ab2dd2 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 @@ -91,26 +91,6 @@ Program { end: { column: 53, line: 4 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSAnyKeyword { - type: "TSAnyKeyword", - - range: [150, 153], - loc: { - start: { column: 54, line: 4 }, - end: { column: 57, line: 4 }, - }, - }, - ], - - range: [149, 154], - loc: { - start: { column: 53, line: 4 }, - end: { column: 58, line: 4 }, - }, - }, range: [140, 154], loc: { 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 0e9179ec241..19934106ad5 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 @@ -66,36 +66,17 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules declare-namespace-w typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSAnyKeyword { -- type: 'TSAnyKeyword', -- -- range: [150, 153], -- loc: { -- start: { column: 54, line: 4 }, -- end: { column: 57, line: 4 }, -- }, -- }, -- ], -- -- range: [149, 154], -- loc: { -- start: { column: 53, line: 4 }, -- end: { column: 58, line: 4 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'Selection', - - range: [140, 149], - loc: { - start: { column: 44, line: 4 }, - end: { column: 53, line: 4 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Selection', ++ ++ range: [140, 149], ++ loc: { ++ start: { column: 44, line: 4 }, ++ end: { column: 53, line: 4 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSAnyKeyword { @@ -115,6 +96,16 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules declare-namespace-w end: { column: 58, line: 4 }, }, }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'Selection', +- +- range: [140, 149], +- loc: { +- start: { column: 44, line: 4 }, +- end: { column: 53, line: 4 }, +- }, +- }, range: [140, 154], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/1-TSESTree-AST.shot index 9aeab0de28a..83f93e40ed7 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/1-TSESTree-AST.shot @@ -201,47 +201,6 @@ Program { end: { column: 21, line: 7 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSInferType { - type: "TSInferType", - typeParameter: TSTypeParameter { - type: "TSTypeParameter", - in: false, - name: Identifier { - type: "Identifier", - name: "U", - - range: [176, 177], - loc: { - start: { column: 28, line: 7 }, - end: { column: 29, line: 7 }, - }, - }, - out: false, - - range: [176, 177], - loc: { - start: { column: 28, line: 7 }, - end: { column: 29, line: 7 }, - }, - }, - - range: [170, 177], - loc: { - start: { column: 22, line: 7 }, - end: { column: 29, line: 7 }, - }, - }, - ], - - range: [169, 178], - loc: { - start: { column: 21, line: 7 }, - end: { column: 30, line: 7 }, - }, - }, range: [162, 178], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/5-AST-Alignment-AST.shot index d93041d6a5c..1af19c84f19 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/5-AST-Alignment-AST.shot @@ -167,57 +167,17 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignme extendsType: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSInferType { -- type: 'TSInferType', -- typeParameter: TSTypeParameter { -- type: 'TSTypeParameter', -- in: false, -- name: Identifier { -- type: 'Identifier', -- name: 'U', -- -- range: [176, 177], -- loc: { -- start: { column: 28, line: 7 }, -- end: { column: 29, line: 7 }, -- }, -- }, -- out: false, -- -- range: [176, 177], -- loc: { -- start: { column: 28, line: 7 }, -- end: { column: 29, line: 7 }, -- }, -- }, -- -- range: [170, 177], -- loc: { -- start: { column: 22, line: 7 }, -- end: { column: 29, line: 7 }, -- }, -- }, -- ], -- -- range: [169, 178], -- loc: { -- start: { column: 21, line: 7 }, -- end: { column: 30, line: 7 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'Promise', - - range: [162, 169], - loc: { - start: { column: 14, line: 7 }, - end: { column: 21, line: 7 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Promise', ++ ++ range: [162, 169], ++ loc: { ++ start: { column: 14, line: 7 }, ++ end: { column: 21, line: 7 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSInferType { @@ -257,6 +217,16 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignme loc: { start: { column: 21, line: 7 }, end: { column: 30, line: 7 }, +- }, +- }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'Promise', +- +- range: [162, 169], +- loc: { +- start: { column: 14, line: 7 }, +- end: { column: 21, line: 7 }, }, }, diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/1-TSESTree-AST.shot index 50862b4fa3e..7ed8756b667 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/1-TSESTree-AST.shot @@ -138,36 +138,6 @@ Program { end: { column: 62, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "U", - - range: [136, 137], - loc: { - start: { column: 63, line: 3 }, - end: { column: 64, line: 3 }, - }, - }, - - range: [136, 137], - loc: { - start: { column: 63, line: 3 }, - end: { column: 64, line: 3 }, - }, - }, - ], - - range: [135, 138], - loc: { - start: { column: 62, line: 3 }, - end: { column: 65, line: 3 }, - }, - }, range: [123, 138], loc: { @@ -394,36 +364,6 @@ Program { end: { column: 16, line: 5 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "U", - - range: [237, 238], - loc: { - start: { column: 17, line: 5 }, - end: { column: 18, line: 5 }, - }, - }, - - range: [237, 238], - loc: { - start: { column: 17, line: 5 }, - end: { column: 18, line: 5 }, - }, - }, - ], - - range: [236, 239], - loc: { - start: { column: 16, line: 5 }, - end: { column: 19, line: 5 }, - }, - }, range: [224, 239], loc: { @@ -641,36 +581,6 @@ Program { end: { column: 16, line: 8 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "U", - - range: [325, 326], - loc: { - start: { column: 17, line: 8 }, - end: { column: 18, line: 8 }, - }, - }, - - range: [325, 326], - loc: { - start: { column: 17, line: 8 }, - end: { column: 18, line: 8 }, - }, - }, - ], - - range: [324, 327], - loc: { - start: { column: 16, line: 8 }, - end: { column: 19, line: 8 }, - }, - }, range: [312, 327], loc: { @@ -888,36 +798,6 @@ Program { end: { column: 16, line: 11 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "U", - - range: [413, 414], - loc: { - start: { column: 17, line: 11 }, - end: { column: 18, line: 11 }, - }, - }, - - range: [413, 414], - loc: { - start: { column: 17, line: 11 }, - end: { column: 18, line: 11 }, - }, - }, - ], - - range: [412, 415], - loc: { - start: { column: 16, line: 11 }, - end: { column: 19, line: 11 }, - }, - }, range: [400, 415], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/5-AST-Alignment-AST.shot index b09be3c8f53..682603238f8 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/5-AST-Alignment-AST.shot @@ -104,46 +104,17 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS trueType: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'U', -- -- range: [136, 137], -- loc: { -- start: { column: 63, line: 3 }, -- end: { column: 64, line: 3 }, -- }, -- }, -- -- range: [136, 137], -- loc: { -- start: { column: 63, line: 3 }, -- end: { column: 64, line: 3 }, -- }, -- }, -- ], -- -- range: [135, 138], -- loc: { -- start: { column: 62, line: 3 }, -- end: { column: 65, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'MustBeNumber', - - range: [123, 135], - loc: { - start: { column: 50, line: 3 }, - end: { column: 62, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'MustBeNumber', ++ ++ range: [123, 135], ++ loc: { ++ start: { column: 50, line: 3 }, ++ end: { column: 62, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -173,7 +144,17 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS end: { column: 65, line: 3 }, }, }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'MustBeNumber', +- range: [123, 135], +- loc: { +- start: { column: 50, line: 3 }, +- end: { column: 62, line: 3 }, +- }, +- }, +- range: [123, 138], loc: { start: { column: 50, line: 3 }, @@ -363,46 +344,17 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS trueType: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'U', -- -- range: [237, 238], -- loc: { -- start: { column: 17, line: 5 }, -- end: { column: 18, line: 5 }, -- }, -- }, -- -- range: [237, 238], -- loc: { -- start: { column: 17, line: 5 }, -- end: { column: 18, line: 5 }, -- }, -- }, -- ], -- -- range: [236, 239], -- loc: { -- start: { column: 16, line: 5 }, -- end: { column: 19, line: 5 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'MustBeNumber', - - range: [224, 236], - loc: { - start: { column: 4, line: 5 }, - end: { column: 16, line: 5 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'MustBeNumber', ++ ++ range: [224, 236], ++ loc: { ++ start: { column: 4, line: 5 }, ++ end: { column: 16, line: 5 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -430,6 +382,16 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS loc: { start: { column: 16, line: 5 }, end: { column: 19, line: 5 }, +- }, +- }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'MustBeNumber', +- +- range: [224, 236], +- loc: { +- start: { column: 4, line: 5 }, +- end: { column: 16, line: 5 }, }, }, @@ -613,46 +575,17 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS trueType: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'U', -- -- range: [325, 326], -- loc: { -- start: { column: 17, line: 8 }, -- end: { column: 18, line: 8 }, -- }, -- }, -- -- range: [325, 326], -- loc: { -- start: { column: 17, line: 8 }, -- end: { column: 18, line: 8 }, -- }, -- }, -- ], -- -- range: [324, 327], -- loc: { -- start: { column: 16, line: 8 }, -- end: { column: 19, line: 8 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'MustBeNumber', - - range: [312, 324], - loc: { - start: { column: 4, line: 8 }, - end: { column: 16, line: 8 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'MustBeNumber', ++ ++ range: [312, 324], ++ loc: { ++ start: { column: 4, line: 8 }, ++ end: { column: 16, line: 8 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -682,7 +615,17 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS end: { column: 19, line: 8 }, }, }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'MustBeNumber', +- range: [312, 324], +- loc: { +- start: { column: 4, line: 8 }, +- end: { column: 16, line: 8 }, +- }, +- }, +- range: [312, 327], loc: { start: { column: 4, line: 8 }, @@ -705,7 +648,8 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS - name: Identifier { - type: 'Identifier', - name: 'T', -- ++ name: 'T', + - range: [259, 260], - loc: { - start: { column: 8, line: 7 }, @@ -713,8 +657,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS - }, - }, - out: false, -+ name: 'T', - +- range: [259, 260], loc: { start: { column: 8, line: 7 }, @@ -863,46 +806,17 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS trueType: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'U', -- -- range: [413, 414], -- loc: { -- start: { column: 17, line: 11 }, -- end: { column: 18, line: 11 }, -- }, -- }, -- -- range: [413, 414], -- loc: { -- start: { column: 17, line: 11 }, -- end: { column: 18, line: 11 }, -- }, -- }, -- ], -- -- range: [412, 415], -- loc: { -- start: { column: 16, line: 11 }, -- end: { column: 19, line: 11 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'MustBeNumber', - - range: [400, 412], - loc: { - start: { column: 4, line: 11 }, - end: { column: 16, line: 11 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'MustBeNumber', ++ ++ range: [400, 412], ++ loc: { ++ start: { column: 4, line: 11 }, ++ end: { column: 16, line: 11 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -930,6 +844,16 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS loc: { start: { column: 16, line: 11 }, end: { column: 19, line: 11 }, +- }, +- }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'MustBeNumber', +- +- range: [400, 412], +- loc: { +- start: { column: 4, line: 11 }, +- end: { column: 16, line: 11 }, }, }, diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/1-TSESTree-AST.shot index 825b95c844b..734795c14ad 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/1-TSESTree-AST.shot @@ -66,46 +66,6 @@ Program { end: { column: 12, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSConstructorType { - type: "TSConstructorType", - abstract: false, - params: Array [], - returnType: TSTypeAnnotation { - type: "TSTypeAnnotation", - typeAnnotation: TSStringKeyword { - type: "TSStringKeyword", - - range: [96, 102], - loc: { - start: { column: 23, line: 3 }, - end: { column: 29, line: 3 }, - }, - }, - - range: [93, 102], - loc: { - start: { column: 20, line: 3 }, - end: { column: 29, line: 3 }, - }, - }, - - range: [86, 102], - loc: { - start: { column: 13, line: 3 }, - end: { column: 29, line: 3 }, - }, - }, - ], - - range: [85, 103], - loc: { - start: { column: 12, line: 3 }, - end: { column: 30, line: 3 }, - }, - }, range: [80, 103], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/5-AST-Alignment-AST.shot index ec23f3c8380..dc267ed0c5a 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/5-AST-Alignment-AST.shot @@ -21,56 +21,17 @@ exports[`AST Fixtures legacy-fixtures types constructor-in-generic AST Alignment typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSConstructorType { -- type: 'TSConstructorType', -- abstract: false, -- params: Array [], -- returnType: TSTypeAnnotation { -- type: 'TSTypeAnnotation', -- typeAnnotation: TSStringKeyword { -- type: 'TSStringKeyword', -- -- range: [96, 102], -- loc: { -- start: { column: 23, line: 3 }, -- end: { column: 29, line: 3 }, -- }, -- }, -- -- range: [93, 102], -- loc: { -- start: { column: 20, line: 3 }, -- end: { column: 29, line: 3 }, -- }, -- }, -- -- range: [86, 102], -- loc: { -- start: { column: 13, line: 3 }, -- end: { column: 29, line: 3 }, -- }, -- }, -- ], -- -- range: [85, 103], -- loc: { -- start: { column: 12, line: 3 }, -- end: { column: 30, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'Array', - - range: [80, 85], - loc: { - start: { column: 7, line: 3 }, - end: { column: 12, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Array', ++ ++ range: [80, 85], ++ loc: { ++ start: { column: 7, line: 3 }, ++ end: { column: 12, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSConstructorType { @@ -110,6 +71,16 @@ exports[`AST Fixtures legacy-fixtures types constructor-in-generic AST Alignment loc: { start: { column: 12, line: 3 }, end: { column: 30, line: 3 }, +- }, +- }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'Array', +- +- range: [80, 85], +- loc: { +- start: { column: 7, line: 3 }, +- end: { column: 12, line: 3 }, }, }, diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/1-TSESTree-AST.shot index c58a7832ac1..aeda4a1ce3e 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/1-TSESTree-AST.shot @@ -65,45 +65,6 @@ Program { end: { column: 12, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSFunctionType { - type: "TSFunctionType", - params: Array [], - returnType: TSTypeAnnotation { - type: "TSTypeAnnotation", - typeAnnotation: TSVoidKeyword { - type: "TSVoidKeyword", - - range: [92, 96], - loc: { - start: { column: 19, line: 3 }, - end: { column: 23, line: 3 }, - }, - }, - - range: [89, 96], - loc: { - start: { column: 16, line: 3 }, - end: { column: 23, line: 3 }, - }, - }, - - range: [86, 96], - loc: { - start: { column: 13, line: 3 }, - end: { column: 23, line: 3 }, - }, - }, - ], - - range: [85, 97], - loc: { - start: { column: 12, line: 3 }, - end: { column: 24, line: 3 }, - }, - }, range: [80, 97], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/5-AST-Alignment-AST.shot index e36d96ae16a..9ef037166e7 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/5-AST-Alignment-AST.shot @@ -21,55 +21,17 @@ exports[`AST Fixtures legacy-fixtures types function-in-generic AST Alignment - typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSFunctionType { -- type: 'TSFunctionType', -- params: Array [], -- returnType: TSTypeAnnotation { -- type: 'TSTypeAnnotation', -- typeAnnotation: TSVoidKeyword { -- type: 'TSVoidKeyword', -- -- range: [92, 96], -- loc: { -- start: { column: 19, line: 3 }, -- end: { column: 23, line: 3 }, -- }, -- }, -- -- range: [89, 96], -- loc: { -- start: { column: 16, line: 3 }, -- end: { column: 23, line: 3 }, -- }, -- }, -- -- range: [86, 96], -- loc: { -- start: { column: 13, line: 3 }, -- end: { column: 23, line: 3 }, -- }, -- }, -- ], -- -- range: [85, 97], -- loc: { -- start: { column: 12, line: 3 }, -- end: { column: 24, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'Array', - - range: [80, 85], - loc: { - start: { column: 7, line: 3 }, - end: { column: 12, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Array', ++ ++ range: [80, 85], ++ loc: { ++ start: { column: 7, line: 3 }, ++ end: { column: 12, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSFunctionType { @@ -108,6 +70,16 @@ exports[`AST Fixtures legacy-fixtures types function-in-generic AST Alignment - loc: { start: { column: 12, line: 3 }, end: { column: 24, line: 3 }, +- }, +- }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'Array', +- +- range: [80, 85], +- loc: { +- start: { column: 7, line: 3 }, +- end: { column: 12, line: 3 }, }, }, diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/1-TSESTree-AST.shot index 0bafaaee4ce..4da3639587f 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/1-TSESTree-AST.shot @@ -98,36 +98,6 @@ Program { end: { column: 43, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "T", - - range: [117, 118], - loc: { - start: { column: 44, line: 3 }, - end: { column: 45, line: 3 }, - }, - }, - - range: [117, 118], - loc: { - start: { column: 44, line: 3 }, - end: { column: 45, line: 3 }, - }, - }, - ], - - range: [116, 119], - loc: { - start: { column: 43, line: 3 }, - end: { column: 46, line: 3 }, - }, - }, range: [106, 119], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/5-AST-Alignment-AST.shot index 17ec5b0d84b..d8f070c681f 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/5-AST-Alignment-AST.shot @@ -63,46 +63,17 @@ exports[`AST Fixtures legacy-fixtures types intersection-type AST Alignment - AS typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'T', -- -- range: [117, 118], -- loc: { -- start: { column: 44, line: 3 }, -- end: { column: 45, line: 3 }, -- }, -- }, -- -- range: [117, 118], -- loc: { -- start: { column: 44, line: 3 }, -- end: { column: 45, line: 3 }, -- }, -- }, -- ], -- -- range: [116, 119], -- loc: { -- start: { column: 43, line: 3 }, -- end: { column: 46, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'LinkedList', - - range: [106, 116], - loc: { - start: { column: 33, line: 3 }, - end: { column: 43, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'LinkedList', ++ ++ range: [106, 116], ++ loc: { ++ start: { column: 33, line: 3 }, ++ end: { column: 43, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -132,7 +103,17 @@ exports[`AST Fixtures legacy-fixtures types intersection-type AST Alignment - AS end: { column: 46, line: 3 }, }, }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'LinkedList', +- range: [106, 116], +- loc: { +- start: { column: 33, line: 3 }, +- end: { column: 43, line: 3 }, +- }, +- }, +- range: [106, 119], loc: { start: { column: 33, line: 3 }, diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/1-TSESTree-AST.shot index 753128d5502..4e1efbfd532 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/1-TSESTree-AST.shot @@ -51,26 +51,6 @@ Program { end: { column: 18, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSNumberKeyword { - type: "TSNumberKeyword", - - range: [92, 98], - loc: { - start: { column: 19, line: 3 }, - end: { column: 25, line: 3 }, - }, - }, - ], - - range: [91, 99], - loc: { - start: { column: 18, line: 3 }, - end: { column: 26, line: 3 }, - }, - }, range: [86, 99], loc: { @@ -96,76 +76,6 @@ Program { end: { column: 12, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeArguments: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSNumberKeyword { - type: "TSNumberKeyword", - - range: [92, 98], - loc: { - start: { column: 19, line: 3 }, - end: { column: 25, line: 3 }, - }, - }, - ], - - range: [91, 99], - loc: { - start: { column: 18, line: 3 }, - end: { column: 26, line: 3 }, - }, - }, - typeName: Identifier { - type: "Identifier", - name: "Array", - - range: [86, 91], - loc: { - start: { column: 13, line: 3 }, - end: { column: 18, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSNumberKeyword { - type: "TSNumberKeyword", - - range: [92, 98], - loc: { - start: { column: 19, line: 3 }, - end: { column: 25, line: 3 }, - }, - }, - ], - - range: [91, 99], - loc: { - start: { column: 18, line: 3 }, - end: { column: 26, line: 3 }, - }, - }, - - range: [86, 99], - loc: { - start: { column: 13, line: 3 }, - end: { column: 26, line: 3 }, - }, - }, - ], - - range: [85, 100], - loc: { - start: { column: 12, line: 3 }, - end: { column: 27, line: 3 }, - }, - }, range: [80, 100], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/5-AST-Alignment-AST.shot index 43214d5f73f..64bf8f7cb98 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/5-AST-Alignment-AST.shot @@ -21,121 +21,33 @@ exports[`AST Fixtures legacy-fixtures types reference-generic-nested AST Alignme typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSNumberKeyword { -- type: 'TSNumberKeyword', -- -- range: [92, 98], -- loc: { -- start: { column: 19, line: 3 }, -- end: { column: 25, line: 3 }, -- }, -- }, -- ], -- -- range: [91, 99], -- loc: { -- start: { column: 18, line: 3 }, -- end: { column: 26, line: 3 }, -- }, -- }, -- typeName: Identifier { -- type: 'Identifier', -- name: 'Array', -- -- range: [86, 91], -- loc: { -- start: { column: 13, line: 3 }, -- end: { column: 18, line: 3 }, -- }, -- }, -- typeParameters: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSNumberKeyword { -- type: 'TSNumberKeyword', -- -- range: [92, 98], -- loc: { -- start: { column: 19, line: 3 }, -- end: { column: 25, line: 3 }, -- }, -- }, -- ], -- -- range: [91, 99], -- loc: { -- start: { column: 18, line: 3 }, -- end: { column: 26, line: 3 }, -- }, -- }, -- -- range: [86, 99], -- loc: { -- start: { column: 13, line: 3 }, -- end: { column: 26, line: 3 }, -- }, -- }, -- ], -- -- range: [85, 100], -- loc: { -- start: { column: 12, line: 3 }, -- end: { column: 27, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'Array', - - range: [80, 85], - loc: { - start: { column: 7, line: 3 }, - end: { column: 12, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Array', ++ ++ range: [80, 85], ++ loc: { ++ start: { column: 7, line: 3 }, ++ end: { column: 12, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSNumberKeyword { -- type: 'TSNumberKeyword', -- -- range: [92, 98], -- loc: { -- start: { column: 19, line: 3 }, -- end: { column: 25, line: 3 }, -- }, -- }, -- ], -- -- range: [91, 99], -- loc: { -- start: { column: 18, line: 3 }, -- end: { column: 26, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'Array', - - range: [86, 91], - loc: { - start: { column: 13, line: 3 }, - end: { column: 18, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Array', ++ ++ range: [86, 91], ++ loc: { ++ start: { column: 13, line: 3 }, ++ end: { column: 18, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSNumberKeyword { @@ -155,7 +67,17 @@ exports[`AST Fixtures legacy-fixtures types reference-generic-nested AST Alignme end: { column: 26, line: 3 }, }, }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'Array', +- range: [86, 91], +- loc: { +- start: { column: 13, line: 3 }, +- end: { column: 18, line: 3 }, +- }, +- }, +- range: [86, 99], loc: { start: { column: 13, line: 3 }, @@ -168,6 +90,16 @@ exports[`AST Fixtures legacy-fixtures types reference-generic-nested AST Alignme loc: { start: { column: 12, line: 3 }, end: { column: 27, line: 3 }, +- }, +- }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'Array', +- +- range: [80, 85], +- loc: { +- start: { column: 7, line: 3 }, +- end: { column: 12, line: 3 }, }, }, diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/1-TSESTree-AST.shot index 1740c35076c..b3699733228 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/1-TSESTree-AST.shot @@ -46,26 +46,6 @@ Program { end: { column: 12, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSNumberKeyword { - type: "TSNumberKeyword", - - range: [86, 92], - loc: { - start: { column: 13, line: 3 }, - end: { column: 19, line: 3 }, - }, - }, - ], - - range: [85, 93], - loc: { - start: { column: 12, line: 3 }, - end: { column: 20, line: 3 }, - }, - }, range: [80, 93], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/5-AST-Alignment-AST.shot index 998644e9180..6b582c9fed5 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/5-AST-Alignment-AST.shot @@ -21,36 +21,17 @@ exports[`AST Fixtures legacy-fixtures types reference-generic AST Alignment - AS typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSNumberKeyword { -- type: 'TSNumberKeyword', -- -- range: [86, 92], -- loc: { -- start: { column: 13, line: 3 }, -- end: { column: 19, line: 3 }, -- }, -- }, -- ], -- -- range: [85, 93], -- loc: { -- start: { column: 12, line: 3 }, -- end: { column: 20, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'Array', - - range: [80, 85], - loc: { - start: { column: 7, line: 3 }, - end: { column: 12, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Array', ++ ++ range: [80, 85], ++ loc: { ++ start: { column: 7, line: 3 }, ++ end: { column: 12, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSNumberKeyword { @@ -68,6 +49,16 @@ exports[`AST Fixtures legacy-fixtures types reference-generic AST Alignment - AS loc: { start: { column: 12, line: 3 }, end: { column: 20, line: 3 }, +- }, +- }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'Array', +- +- range: [80, 85], +- loc: { +- start: { column: 7, line: 3 }, +- end: { column: 12, line: 3 }, }, }, diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/1-TSESTree-AST.shot index 6e8c437206f..efdbfb5b954 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/1-TSESTree-AST.shot @@ -133,36 +133,6 @@ Program { end: { column: 14, line: 4 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "T", - - range: [134, 135], - loc: { - start: { column: 15, line: 4 }, - end: { column: 16, line: 4 }, - }, - }, - - range: [134, 135], - loc: { - start: { column: 15, line: 4 }, - end: { column: 16, line: 4 }, - }, - }, - ], - - range: [133, 136], - loc: { - start: { column: 14, line: 4 }, - end: { column: 17, line: 4 }, - }, - }, range: [124, 136], loc: { @@ -212,36 +182,6 @@ Program { end: { column: 32, line: 4 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "T", - - range: [152, 153], - loc: { - start: { column: 33, line: 4 }, - end: { column: 34, line: 4 }, - }, - }, - - range: [152, 153], - loc: { - start: { column: 33, line: 4 }, - end: { column: 34, line: 4 }, - }, - }, - ], - - range: [151, 154], - loc: { - start: { column: 32, line: 4 }, - end: { column: 35, line: 4 }, - }, - }, range: [142, 154], loc: { @@ -291,36 +231,6 @@ Program { end: { column: 51, line: 4 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "T", - - range: [171, 172], - loc: { - start: { column: 52, line: 4 }, - end: { column: 53, line: 4 }, - }, - }, - - range: [171, 172], - loc: { - start: { column: 52, line: 4 }, - end: { column: 53, line: 4 }, - }, - }, - ], - - range: [170, 173], - loc: { - start: { column: 51, line: 4 }, - end: { column: 54, line: 4 }, - }, - }, range: [160, 173], loc: { @@ -370,36 +280,6 @@ Program { end: { column: 72, line: 4 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "T", - - range: [192, 193], - loc: { - start: { column: 73, line: 4 }, - end: { column: 74, line: 4 }, - }, - }, - - range: [192, 193], - loc: { - start: { column: 73, line: 4 }, - end: { column: 74, line: 4 }, - }, - }, - ], - - range: [191, 194], - loc: { - start: { column: 72, line: 4 }, - end: { column: 75, line: 4 }, - }, - }, range: [179, 194], loc: { @@ -518,37 +398,6 @@ Program { end: { column: 33, line: 5 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSLiteralType { - type: "TSLiteralType", - literal: Literal { - type: "Literal", - raw: "'heLLo'", - value: "heLLo", - - range: [232, 239], - loc: { - start: { column: 34, line: 5 }, - end: { column: 41, line: 5 }, - }, - }, - - range: [232, 239], - loc: { - start: { column: 34, line: 5 }, - end: { column: 41, line: 5 }, - }, - }, - ], - - range: [231, 240], - loc: { - start: { column: 33, line: 5 }, - end: { column: 42, line: 5 }, - }, - }, range: [211, 240], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/5-AST-Alignment-AST.shot index 5819613357d..33e03622c80 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/5-AST-Alignment-AST.shot @@ -96,13 +96,7 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen - 'cooked': ' - ', - 'raw': ' - ', - }, -+ range: [134, 135], -+ loc: { -+ start: { column: 15, line: 4 }, -+ end: { column: 16, line: 4 }, -+ }, -+ }, - +- - range: [173, 179], - loc: { - start: { column: 54, line: 4 }, @@ -135,7 +129,13 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen - typeName: Identifier { - type: 'Identifier', - name: 'T', -- ++ range: [134, 135], ++ loc: { ++ start: { column: 15, line: 4 }, ++ end: { column: 16, line: 4 }, ++ }, ++ }, + range: [134, 135], loc: { start: { column: 15, line: 4 }, @@ -155,62 +155,34 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + end: { column: 17, line: 4 }, }, - ], -- ++ }, + - range: [133, 136], -- loc: { ++ range: [124, 136], + loc: { - start: { column: 14, line: 4 }, -- end: { column: 17, line: 4 }, ++ start: { column: 5, line: 4 }, + end: { column: 17, line: 4 }, }, -- }, + }, - typeName: Identifier { - type: 'Identifier', - name: 'Uppercase', - -- range: [124, 133], -+ range: [124, 136], - loc: { - start: { column: 5, line: 4 }, -- end: { column: 14, line: 4 }, -+ end: { column: 17, line: 4 }, - }, - }, -- typeParameters: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'T', -- -- range: [134, 135], -- loc: { -- start: { column: 15, line: 4 }, -- end: { column: 16, line: 4 }, -- }, -- }, + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'Lowercase', -- range: [134, 135], -- loc: { -- start: { column: 15, line: 4 }, -- end: { column: 16, line: 4 }, -- }, +- range: [124, 133], +- loc: { +- start: { column: 5, line: 4 }, +- end: { column: 14, line: 4 }, + range: [142, 151], + loc: { + start: { column: 23, line: 4 }, + end: { column: 32, line: 4 }, - }, -- ], -- -- range: [133, 136], -- loc: { -- start: { column: 14, line: 4 }, -- end: { column: 17, line: 4 }, ++ }, }, - }, + typeParameters: TSTypeParameterInstantiation { @@ -264,62 +236,34 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + end: { column: 35, line: 4 }, }, - ], -- ++ }, + - range: [151, 154], -- loc: { ++ range: [142, 154], + loc: { - start: { column: 32, line: 4 }, -- end: { column: 35, line: 4 }, ++ start: { column: 23, line: 4 }, + end: { column: 35, line: 4 }, }, -- }, + }, - typeName: Identifier { - type: 'Identifier', - name: 'Lowercase', - -- range: [142, 151], -+ range: [142, 154], - loc: { - start: { column: 23, line: 4 }, -- end: { column: 32, line: 4 }, -+ end: { column: 35, line: 4 }, - }, - }, -- typeParameters: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'T', -- -- range: [152, 153], -- loc: { -- start: { column: 33, line: 4 }, -- end: { column: 34, line: 4 }, -- }, -- }, + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'Capitalize', -- range: [152, 153], -- loc: { -- start: { column: 33, line: 4 }, -- end: { column: 34, line: 4 }, -- }, +- range: [142, 151], +- loc: { +- start: { column: 23, line: 4 }, +- end: { column: 32, line: 4 }, + range: [160, 170], + loc: { + start: { column: 41, line: 4 }, + end: { column: 51, line: 4 }, - }, -- ], -- -- range: [151, 154], -- loc: { -- start: { column: 32, line: 4 }, -- end: { column: 35, line: 4 }, ++ }, }, - }, + typeParameters: TSTypeParameterInstantiation { @@ -373,62 +317,34 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + end: { column: 54, line: 4 }, }, - ], -- ++ }, + - range: [170, 173], -- loc: { ++ range: [160, 173], + loc: { - start: { column: 51, line: 4 }, -- end: { column: 54, line: 4 }, ++ start: { column: 41, line: 4 }, + end: { column: 54, line: 4 }, }, -- }, + }, - typeName: Identifier { - type: 'Identifier', - name: 'Capitalize', - -- range: [160, 170], -+ range: [160, 173], - loc: { - start: { column: 41, line: 4 }, -- end: { column: 51, line: 4 }, -+ end: { column: 54, line: 4 }, - }, - }, -- typeParameters: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'T', -- -- range: [171, 172], -- loc: { -- start: { column: 52, line: 4 }, -- end: { column: 53, line: 4 }, -- }, -- }, + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'Uncapitalize', -- range: [171, 172], -- loc: { -- start: { column: 52, line: 4 }, -- end: { column: 53, line: 4 }, -- }, +- range: [160, 170], +- loc: { +- start: { column: 41, line: 4 }, +- end: { column: 51, line: 4 }, + range: [179, 191], + loc: { + start: { column: 60, line: 4 }, + end: { column: 72, line: 4 }, - }, -- ], -- -- range: [170, 173], -- loc: { -- start: { column: 51, line: 4 }, -- end: { column: 54, line: 4 }, ++ }, }, - }, + typeParameters: TSTypeParameterInstantiation { @@ -504,24 +420,13 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + 'cooked': '', + 'raw': '', + }, - -- range: [179, 191], ++ + range: [121, 124], - loc: { -- start: { column: 60, line: 4 }, -- end: { column: 72, line: 4 }, ++ loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, - }, - }, -- typeParameters: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'T', ++ }, ++ }, + TemplateElement { + type: 'TemplateElement', + tail: false, @@ -530,14 +435,11 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + 'raw': ' - ', + }, -- range: [192, 193], -- loc: { -- start: { column: 73, line: 4 }, -- end: { column: 74, line: 4 }, -- }, -- }, +- range: [179, 191], + range: [136, 142], -+ loc: { + loc: { +- start: { column: 60, line: 4 }, +- end: { column: 72, line: 4 }, + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, + }, @@ -548,21 +450,14 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + value: Object { + 'cooked': ' - ', + 'raw': ' - ', -+ }, - -- range: [192, 193], -- loc: { -- start: { column: 73, line: 4 }, -- end: { column: 74, line: 4 }, -- }, -- }, -- ], + }, ++ + range: [154, 160], + loc: { + start: { column: 35, line: 4 }, + end: { column: 41, line: 4 }, + }, -+ }, + }, + TemplateElement { + type: 'TemplateElement', + tail: false, @@ -571,15 +466,16 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + 'raw': ' - ', + }, -- range: [191, 194], +- range: [179, 194], +- loc: { +- start: { column: 60, line: 4 }, +- end: { column: 75, line: 4 }, + range: [173, 179], - loc: { -- start: { column: 72, line: 4 }, -- end: { column: 75, line: 4 }, ++ loc: { + start: { column: 54, line: 4 }, + end: { column: 60, line: 4 }, - }, - }, ++ }, ++ }, + TemplateElement { + type: 'TemplateElement', + tail: true, @@ -587,11 +483,7 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + 'cooked': '', + 'raw': '', + }, - -- range: [179, 194], -- loc: { -- start: { column: 60, line: 4 }, -- end: { column: 75, line: 4 }, ++ + range: [194, 196], + loc: { + start: { column: 75, line: 4 }, @@ -678,47 +570,17 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSLiteralType { -- type: 'TSLiteralType', -- literal: Literal { -- type: 'Literal', -- raw: '\\\\'heLLo\\\\'', -- value: 'heLLo', -- -- range: [232, 239], -- loc: { -- start: { column: 34, line: 5 }, -- end: { column: 41, line: 5 }, -- }, -- }, -- -- range: [232, 239], -- loc: { -- start: { column: 34, line: 5 }, -- end: { column: 41, line: 5 }, -- }, -- }, -- ], -- -- range: [231, 240], -- loc: { -- start: { column: 33, line: 5 }, -- end: { column: 42, line: 5 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', - name: 'EnthusiasticGreeting', - - range: [211, 231], - loc: { - start: { column: 13, line: 5 }, - end: { column: 33, line: 5 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'EnthusiasticGreeting', ++ ++ range: [211, 231], ++ loc: { ++ start: { column: 13, line: 5 }, ++ end: { column: 33, line: 5 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSLiteralType { @@ -747,6 +609,16 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen loc: { start: { column: 33, line: 5 }, end: { column: 42, line: 5 }, +- }, +- }, +- typeName: Identifier { +- type: 'Identifier', +- name: 'EnthusiasticGreeting', +- +- range: [211, 231], +- loc: { +- start: { column: 13, line: 5 }, +- end: { column: 33, line: 5 }, }, }, diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/1-TSESTree-AST.shot index 7b655eafbec..662a83282b2 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/1-TSESTree-AST.shot @@ -75,36 +75,6 @@ Program { end: { column: 20, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "w", - - range: [91, 92], - loc: { - start: { column: 18, line: 3 }, - end: { column: 19, line: 3 }, - }, - }, - - range: [91, 92], - loc: { - start: { column: 18, line: 3 }, - end: { column: 19, line: 3 }, - }, - }, - ], - - range: [90, 93], - loc: { - start: { column: 17, line: 3 }, - end: { column: 20, line: 3 }, - }, - }, range: [80, 93], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/5-AST-Alignment-AST.shot index a194ac6f2e6..fea5bfa9fbf 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/5-AST-Alignment-AST.shot @@ -50,36 +50,7 @@ exports[`AST Fixtures legacy-fixtures types typeof-with-type-parameters AST Alig }, }, - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'w', -- -- range: [91, 92], -- loc: { -- start: { column: 18, line: 3 }, -- end: { column: 19, line: 3 }, -- }, -- }, -- -- range: [91, 92], -- loc: { -- start: { column: 18, line: 3 }, -- end: { column: 19, line: 3 }, -- }, -- }, -- ], -- -- range: [90, 93], -- loc: { -- start: { column: 17, line: 3 }, -- end: { column: 20, line: 3 }, -- }, -- }, - typeParameters: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { diff --git a/packages/typescript-estree/src/ast-converter.ts b/packages/typescript-estree/src/ast-converter.ts index 0e55541969d..d2e4f3ff761 100644 --- a/packages/typescript-estree/src/ast-converter.ts +++ b/packages/typescript-estree/src/ast-converter.ts @@ -26,8 +26,10 @@ export function astConverter( * Recursively convert the TypeScript AST into an ESTree-compatible AST */ const instance = new Converter(ast, { - errorOnUnknownASTType: parseSettings.errorOnUnknownASTType || false, + errorOnUnknownASTType: parseSettings.errorOnUnknownASTType, shouldPreserveNodeMaps, + suppressDeprecatedPropertyWarnings: + parseSettings.suppressDeprecatedPropertyWarnings, }); const estree = instance.convertProgram(); diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index f3b093dc2a7..70a9369cb2e 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -36,9 +36,10 @@ import { AST_NODE_TYPES } from './ts-estree'; const SyntaxKind = ts.SyntaxKind; -interface ConverterOptions { - errorOnUnknownASTType: boolean; - shouldPreserveNodeMaps: boolean; +export interface ConverterOptions { + errorOnUnknownASTType?: boolean; + shouldPreserveNodeMaps?: boolean; + suppressDeprecatedPropertyWarnings?: boolean; } /** @@ -75,7 +76,7 @@ export class Converter { * @param options additional options for the conversion * @returns the converted ESTreeNode */ - constructor(ast: ts.SourceFile, options: ConverterOptions) { + constructor(ast: ts.SourceFile, options?: ConverterOptions) { this.ast = ast; this.options = { ...options }; } @@ -474,13 +475,18 @@ export class Converter { : null; } if ('typeArguments' in node) { - result.typeArguments = result.typeParameters = + result.typeArguments = node.typeArguments && 'pos' in node.typeArguments ? this.convertTypeArgumentsToTypeParameterInstantiation( node.typeArguments, node, ) : null; + this.#addDeprecatedTypeParametersGetter( + result, + 'typeParameters', + 'typeArguments', + ); } if ('typeParameters' in node) { result.typeParameters = @@ -1077,6 +1083,7 @@ export class Converter { case SyntaxKind.ShorthandPropertyAssignment: { this.#throwErrorIfDeprecatedPropertyExists( node, + // eslint-disable-next-line deprecation/deprecation node.modifiers, 'A shorthand property assignment cannot have modifiers.', @@ -1553,19 +1560,28 @@ export class Converter { } case SyntaxKind.TaggedTemplateExpression: { - const typeArguments = node.typeArguments - ? this.convertTypeArgumentsToTypeParameterInstantiation( - node.typeArguments, - node, - ) - : undefined; - return this.createNode(node, { - type: AST_NODE_TYPES.TaggedTemplateExpression, - typeArguments, - typeParameters: typeArguments, - tag: this.convertChild(node.tag), - quasi: this.convertChild(node.template), - }); + const result = this.createNode( + node, + { + type: AST_NODE_TYPES.TaggedTemplateExpression, + typeArguments: node.typeArguments + ? this.convertTypeArgumentsToTypeParameterInstantiation( + node.typeArguments, + node, + ) + : undefined, + tag: this.convertChild(node.tag), + quasi: this.convertChild(node.template), + }, + ); + + this.#addDeprecatedTypeParametersGetter( + result, + 'typeParameters', + 'typeArguments', + ); + + return result; } case SyntaxKind.TemplateHead: @@ -1715,12 +1731,16 @@ export class Converter { } if (superClass.types[0]?.typeArguments) { - // eslint-disable-next-line deprecation/deprecation - result.superTypeArguments = result.superTypeParameters = + result.superTypeArguments = this.convertTypeArgumentsToTypeParameterInstantiation( superClass.types[0].typeArguments, superClass.types[0], ); + this.#addDeprecatedTypeParametersGetter( + result, + 'superTypeParameters', + 'superTypeArguments', + ); } } @@ -2062,12 +2082,17 @@ export class Converter { }); if (node.typeArguments) { - // eslint-disable-next-line deprecation/deprecation - result.typeArguments = result.typeParameters = + result.typeArguments = this.convertTypeArgumentsToTypeParameterInstantiation( node.typeArguments, node, ); + + this.#addDeprecatedTypeParametersGetter( + result, + 'typeParameters', + 'typeArguments', + ); } return this.convertChainExpression(result, node); @@ -2083,12 +2108,17 @@ export class Converter { : [], }); if (node.typeArguments) { - // eslint-disable-next-line deprecation/deprecation - result.typeArguments = result.typeParameters = + result.typeArguments = this.convertTypeArgumentsToTypeParameterInstantiation( node.typeArguments, node, ); + + this.#addDeprecatedTypeParametersGetter( + result, + 'typeParameters', + 'typeArguments', + ); } return result; } @@ -2236,13 +2266,7 @@ export class Converter { }); case SyntaxKind.JsxSelfClosingElement: { - const typeArguments = node.typeArguments - ? this.convertTypeArgumentsToTypeParameterInstantiation( - node.typeArguments, - node, - ) - : undefined; - return this.createNode(node, { + const result = this.createNode(node, { type: AST_NODE_TYPES.JSXElement, /** * Convert SyntaxKind.JsxSelfClosingElement to SyntaxKind.JsxOpeningElement, @@ -2250,8 +2274,12 @@ export class Converter { */ openingElement: this.createNode(node, { type: AST_NODE_TYPES.JSXOpeningElement, - typeArguments, - typeParameters: typeArguments, + typeArguments: node.typeArguments + ? this.convertTypeArgumentsToTypeParameterInstantiation( + node.typeArguments, + node, + ) + : undefined, selfClosing: true, name: this.convertJSXTagName(node.tagName, node), attributes: node.attributes.properties.map(el => @@ -2262,10 +2290,18 @@ export class Converter { closingElement: null, children: [], }); + + this.#addDeprecatedTypeParametersGetter( + result.openingElement, + 'typeParameters', + 'typeArguments', + ); + + return result; } - case SyntaxKind.JsxOpeningElement: - return this.createNode(node, { + case SyntaxKind.JsxOpeningElement: { + const result = this.createNode(node, { type: AST_NODE_TYPES.JSXOpeningElement, typeArguments: node.typeArguments ? this.convertTypeArgumentsToTypeParameterInstantiation( @@ -2280,6 +2316,15 @@ export class Converter { ), }); + this.#addDeprecatedTypeParametersGetter( + result, + 'typeParameters', + 'typeArguments', + ); + + return result; + } + case SyntaxKind.JsxClosingElement: return this.createNode(node, { type: AST_NODE_TYPES.JSXClosingElement, @@ -2355,18 +2400,24 @@ export class Converter { // TypeScript specific case SyntaxKind.TypeReference: { - const typeArguments = node.typeArguments - ? this.convertTypeArgumentsToTypeParameterInstantiation( - node.typeArguments, - node, - ) - : undefined; - return this.createNode(node, { + const result = this.createNode(node, { type: AST_NODE_TYPES.TSTypeReference, typeName: this.convertChild(node.typeName), - typeArguments, - typeParameters: typeArguments, + typeArguments: node.typeArguments + ? this.convertTypeArgumentsToTypeParameterInstantiation( + node.typeArguments, + node, + ) + : undefined, }); + + this.#addDeprecatedTypeParametersGetter( + result, + 'typeParameters', + 'typeArguments', + ); + + return result; } case SyntaxKind.TypeParameter: { @@ -2446,18 +2497,24 @@ export class Converter { } case SyntaxKind.TypeQuery: { - const typeArguments = - node.typeArguments && - this.convertTypeArgumentsToTypeParameterInstantiation( - node.typeArguments, - node, - ); - return this.createNode(node, { + const result = this.createNode(node, { type: AST_NODE_TYPES.TSTypeQuery, exprName: this.convertChild(node.exprName), - typeArguments, - typeParameters: typeArguments, + typeArguments: + node.typeArguments && + this.convertTypeArgumentsToTypeParameterInstantiation( + node.typeArguments, + node, + ), }); + + this.#addDeprecatedTypeParametersGetter( + result, + 'typeParameters', + 'typeArguments', + ); + + return result; } case SyntaxKind.MappedType: { @@ -2657,16 +2714,20 @@ export class Converter { >(node, { type, expression: this.convertChild(node.expression), - }); - - if (node.typeArguments) { - // eslint-disable-next-line deprecation/deprecation - result.typeArguments = result.typeParameters = + typeArguments: + node.typeArguments && this.convertTypeArgumentsToTypeParameterInstantiation( node.typeArguments, node, - ); - } + ), + }); + + this.#addDeprecatedTypeParametersGetter( + result, + 'typeParameters', + 'typeArguments', + ); + return result; } @@ -2739,20 +2800,25 @@ export class Converter { const token = findNextToken(node.getFirstToken()!, node, this.ast)!; range[0] = token.getStart(this.ast); } - const typeArguments = node.typeArguments - ? this.convertTypeArgumentsToTypeParameterInstantiation( - node.typeArguments, - node, - ) - : null; const result = this.createNode(node, { type: AST_NODE_TYPES.TSImportType, argument: this.convertChild(node.argument), qualifier: this.convertChild(node.qualifier), - typeArguments, - typeParameters: typeArguments, + typeArguments: node.typeArguments + ? this.convertTypeArgumentsToTypeParameterInstantiation( + node.typeArguments, + node, + ) + : null, range: range, - }); + } as TSESTree.TSImportType); + + this.#addDeprecatedTypeParametersGetter( + result, + 'typeParameters', + 'typeArguments', + ); + if (node.isTypeOf) { return this.createNode(node, { type: AST_NODE_TYPES.TSTypeQuery, @@ -3089,4 +3155,35 @@ export class Converter { throw createError(this.ast, node.pos, message); } } + + /** + * Creates a getter for a property under aliasKey that returns the value under + * valueKey. If suppressDeprecatedPropertyWarnings is not enabled, the + * getter also console warns about the deprecation. + * + * @see https://github.com/typescript-eslint/typescript-eslint/issues/6469 + */ + #addDeprecatedTypeParametersGetter( + node: Node, + aliasKey: keyof Node & string, + valueKey: keyof Node & string, + ): void { + let errored = false; + Object.defineProperty(node, aliasKey, { + get: this.options.suppressDeprecatedPropertyWarnings + ? (): Node[typeof valueKey] => node[valueKey] + : (): Node[typeof valueKey] => { + if (!this.options.suppressDeprecatedPropertyWarnings) { + if (!errored) { + // eslint-disable-next-line no-console + console.warn( + `The '${aliasKey}' property is deprecated on ${node.type} nodes. Use '${valueKey}' instead.`, + ); + errored = true; + } + } + return node[valueKey]; + }, + }); + } } diff --git a/packages/typescript-estree/src/parseSettings/createParseSettings.ts b/packages/typescript-estree/src/parseSettings/createParseSettings.ts index e17cd119adc..9deceb8221d 100644 --- a/packages/typescript-estree/src/parseSettings/createParseSettings.ts +++ b/packages/typescript-estree/src/parseSettings/createParseSettings.ts @@ -73,6 +73,9 @@ export function createParseSettings( projects: [], range: options.range === true, singleRun, + suppressDeprecatedPropertyWarnings: + options.suppressDeprecatedPropertyWarnings ?? + process.env.NODE_ENV !== 'test', tokens: options.tokens === true ? [] : null, tsconfigMatchCache: (TSCONFIG_MATCH_CACHE ??= new ExpiringCache( singleRun diff --git a/packages/typescript-estree/src/parseSettings/index.ts b/packages/typescript-estree/src/parseSettings/index.ts index cde75b568e8..a76432690e0 100644 --- a/packages/typescript-estree/src/parseSettings/index.ts +++ b/packages/typescript-estree/src/parseSettings/index.ts @@ -118,6 +118,11 @@ export interface MutableParseSettings { */ singleRun: boolean; + /** + * Whether deprecated AST properties should skip calling console.warn on accesses. + */ + suppressDeprecatedPropertyWarnings: boolean; + /** * If the `tokens` parse option is enabled, retrieved tokens. */ diff --git a/packages/typescript-estree/src/parser-options.ts b/packages/typescript-estree/src/parser-options.ts index 742864d4e47..a42d0134127 100644 --- a/packages/typescript-estree/src/parser-options.ts +++ b/packages/typescript-estree/src/parser-options.ts @@ -75,6 +75,11 @@ interface ParseOptions { * Set to true to create a top-level array containing all tokens from the file. */ tokens?: boolean; + + /** + * Whether deprecated AST properties should skip calling console.warn on accesses. + */ + suppressDeprecatedPropertyWarnings?: boolean; } interface ParseAndGenerateServicesOptions extends ParseOptions { 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 4439ae36ee0..a412b6bc0c9 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap @@ -143,63 +143,6 @@ exports[`convert deeplyCopy should convert array of nodes 1`] = ` ], "type": "Identifier", }, - "typeParameters": undefined, - }, - ], - "range": [ - 7, - 10, - ], - "type": "TSTypeParameterInstantiation", - }, - "typeParameters": { - "loc": { - "end": { - "column": 10, - "line": 1, - }, - "start": { - "column": 7, - "line": 1, - }, - }, - "params": [ - { - "loc": { - "end": { - "column": 9, - "line": 1, - }, - "start": { - "column": 8, - "line": 1, - }, - }, - "range": [ - 8, - 9, - ], - "type": "TSTypeReference", - "typeArguments": undefined, - "typeName": { - "loc": { - "end": { - "column": 9, - "line": 1, - }, - "start": { - "column": 8, - "line": 1, - }, - }, - "name": "T", - "range": [ - 8, - 9, - ], - "type": "Identifier", - }, - "typeParameters": undefined, }, ], "range": [ @@ -453,63 +396,6 @@ exports[`convert deeplyCopy should convert node with type arguments correctly 1` ], "type": "Identifier", }, - "typeParameters": undefined, - }, - ], - "range": [ - 7, - 10, - ], - "type": "TSTypeParameterInstantiation", - }, - "typeParameters": { - "loc": { - "end": { - "column": 10, - "line": 1, - }, - "start": { - "column": 7, - "line": 1, - }, - }, - "params": [ - { - "loc": { - "end": { - "column": 9, - "line": 1, - }, - "start": { - "column": 8, - "line": 1, - }, - }, - "range": [ - 8, - 9, - ], - "type": "TSTypeReference", - "typeArguments": undefined, - "typeName": { - "loc": { - "end": { - "column": 9, - "line": 1, - }, - "start": { - "column": 8, - "line": 1, - }, - }, - "name": "T", - "range": [ - 8, - 9, - ], - "type": "Identifier", - }, - "typeParameters": undefined, }, ], "range": [ diff --git a/packages/typescript-estree/tests/lib/__snapshots__/parse.test.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/parse.test.ts.snap index 58d69423139..bfb59526f59 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/parse.test.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/parse.test.ts.snap @@ -157,7 +157,6 @@ exports[`parseAndGenerateServices isolated parsing should parse .js file - with "selfClosing": true, "type": "JSXOpeningElement", "typeArguments": undefined, - "typeParameters": undefined, }, "range": [ 10, @@ -447,7 +446,6 @@ exports[`parseAndGenerateServices isolated parsing should parse .js file - with "selfClosing": true, "type": "JSXOpeningElement", "typeArguments": undefined, - "typeParameters": undefined, }, "range": [ 10, @@ -1313,7 +1311,6 @@ exports[`parseAndGenerateServices isolated parsing should parse .jsx file - with "selfClosing": true, "type": "JSXOpeningElement", "typeArguments": undefined, - "typeParameters": undefined, }, "range": [ 10, @@ -1603,7 +1600,6 @@ exports[`parseAndGenerateServices isolated parsing should parse .jsx file - with "selfClosing": true, "type": "JSXOpeningElement", "typeArguments": undefined, - "typeParameters": undefined, }, "range": [ 10, @@ -2609,7 +2605,6 @@ exports[`parseAndGenerateServices isolated parsing should parse .tsx file - with "selfClosing": true, "type": "JSXOpeningElement", "typeArguments": undefined, - "typeParameters": undefined, }, "range": [ 10, @@ -2899,7 +2894,6 @@ exports[`parseAndGenerateServices isolated parsing should parse .tsx file - with "selfClosing": true, "type": "JSXOpeningElement", "typeArguments": undefined, - "typeParameters": undefined, }, "range": [ 10, @@ -3547,7 +3541,6 @@ exports[`parseAndGenerateServices isolated parsing should parse .vue file - with "selfClosing": true, "type": "JSXOpeningElement", "typeArguments": undefined, - "typeParameters": undefined, }, "range": [ 10, diff --git a/packages/typescript-estree/tests/lib/convert.test.ts b/packages/typescript-estree/tests/lib/convert.test.ts index fb3ac3f6313..4f32a3f41d6 100644 --- a/packages/typescript-estree/tests/lib/convert.test.ts +++ b/packages/typescript-estree/tests/lib/convert.test.ts @@ -1,7 +1,9 @@ +import type { TSESTree } from '@typescript-eslint/types'; import { AST_NODE_TYPES } from '@typescript-eslint/types'; import * as ts from 'typescript'; import type { TSNode } from '../../src'; +import type { ConverterOptions } from '../../src/convert'; import { Converter } from '../../src/convert'; describe('convert', () => { @@ -26,20 +28,14 @@ describe('convert', () => { ts.forEachChild(ast, fakeUnknownKind); - const instance = new Converter(ast, { - errorOnUnknownASTType: false, - shouldPreserveNodeMaps: false, - }); + const instance = new Converter(ast); expect(instance.convertProgram()).toMatchSnapshot(); }); it('deeplyCopy should convert node with decorators correctly', () => { const ast = convertCode('@test class foo {}'); - const instance = new Converter(ast, { - errorOnUnknownASTType: false, - shouldPreserveNodeMaps: false, - }); + const instance = new Converter(ast); expect( instance['deeplyCopy'](ast.statements[0] as ts.ClassDeclaration), @@ -49,10 +45,7 @@ describe('convert', () => { it('deeplyCopy should convert node with type parameters correctly', () => { const ast = convertCode('class foo {}'); - const instance = new Converter(ast, { - errorOnUnknownASTType: false, - shouldPreserveNodeMaps: false, - }); + const instance = new Converter(ast); expect( instance['deeplyCopy'](ast.statements[0] as ts.ClassDeclaration), @@ -62,10 +55,7 @@ describe('convert', () => { it('deeplyCopy should convert node with type arguments correctly', () => { const ast = convertCode('new foo()'); - const instance = new Converter(ast, { - errorOnUnknownASTType: false, - shouldPreserveNodeMaps: false, - }); + const instance = new Converter(ast); expect( instance['deeplyCopy']( @@ -78,10 +68,7 @@ describe('convert', () => { it('deeplyCopy should convert array of nodes', () => { const ast = convertCode('new foo()'); - const instance = new Converter(ast, { - errorOnUnknownASTType: false, - shouldPreserveNodeMaps: false, - }); + const instance = new Converter(ast); expect(instance['deeplyCopy'](ast)).toMatchSnapshot(); }); @@ -90,7 +77,6 @@ describe('convert', () => { const instance = new Converter(ast, { errorOnUnknownASTType: true, - shouldPreserveNodeMaps: false, }); expect(() => instance['deeplyCopy'](ast)).toThrow( @@ -107,7 +93,6 @@ describe('convert', () => { `); const instance = new Converter(ast, { - errorOnUnknownASTType: false, shouldPreserveNodeMaps: true, }); instance.convertProgram(); @@ -140,7 +125,6 @@ describe('convert', () => { const ast = convertCode(``); const instance = new Converter(ast, { - errorOnUnknownASTType: false, shouldPreserveNodeMaps: true, }); instance.convertProgram(); @@ -172,7 +156,6 @@ describe('convert', () => { const ast = convertCode(`export function foo () {}`); const instance = new Converter(ast, { - errorOnUnknownASTType: false, shouldPreserveNodeMaps: true, }); const program = instance.convertProgram(); @@ -203,7 +186,6 @@ describe('convert', () => { it('should correctly create node with range and loc set', () => { const ast = convertCode(''); const instance = new Converter(ast, { - errorOnUnknownASTType: false, shouldPreserveNodeMaps: true, }); @@ -252,13 +234,70 @@ describe('convert', () => { for (const code of jsDocCode) { const ast = convertCode(code); - const instance = new Converter(ast, { - errorOnUnknownASTType: false, - shouldPreserveNodeMaps: false, - }); + const instance = new Converter(ast); expect(() => instance.convertProgram()).toThrow( 'JSDoc types can only be used inside documentation comments.', ); } }); + + describe('suppressDeprecatedPropertyWarnings', () => { + const getEsCallExpression = ( + converterOptions: ConverterOptions, + ): TSESTree.CallExpression => { + const ast = convertCode(`callee();`); + const tsCallExpression = (ast.statements[0] as ts.ExpressionStatement) + .expression as ts.CallExpression; + const instance = new Converter(ast, { + shouldPreserveNodeMaps: true, + ...converterOptions, + }); + + instance.convertProgram(); + + const maps = instance.getASTMaps(); + + return maps.tsNodeToESTreeNodeMap.get(tsCallExpression); + }; + + it('logs on a deprecated property access when suppressDeprecatedPropertyWarnings is false', () => { + const warn = jest.spyOn(console, 'warn').mockImplementation(); + const esCallExpression = getEsCallExpression({ + suppressDeprecatedPropertyWarnings: false, + }); + + // eslint-disable-next-line deprecation/deprecation + esCallExpression.typeParameters; + + expect(warn).toHaveBeenCalledWith( + `The 'typeParameters' property is deprecated on CallExpression nodes. Use 'typeArguments' instead.`, + ); + }); + + it('does not log on a subsequent deprecated property access when suppressDeprecatedPropertyWarnings is false', () => { + const warn = jest.spyOn(console, 'warn').mockImplementation(); + const esCallExpression = getEsCallExpression({ + suppressDeprecatedPropertyWarnings: false, + }); + + /* eslint-disable deprecation/deprecation */ + esCallExpression.typeParameters; + esCallExpression.typeParameters; + /* eslint-enable deprecation/deprecation */ + + expect(warn).toHaveBeenCalledTimes(1); + }); + + it('does not log on a deprecated property access when suppressDeprecatedPropertyWarnings is true', () => { + const warn = jest.spyOn(console, 'warn').mockImplementation(); + const esCallExpression = getEsCallExpression({ + suppressDeprecatedPropertyWarnings: true, + }); + + // eslint-disable-next-line deprecation/deprecation + esCallExpression.typeParameters; + + expect(warn).not.toHaveBeenCalled(); + }); + }); }); diff --git a/packages/website/src/components/linter/config.ts b/packages/website/src/components/linter/config.ts index 2360a3106b5..44f852a8905 100644 --- a/packages/website/src/components/linter/config.ts +++ b/packages/website/src/components/linter/config.ts @@ -22,6 +22,7 @@ export const parseSettings: ParseSettings = { errorOnTypeScriptSyntacticAndSemanticIssues: false, EXPERIMENTAL_useSourceOfProjectReferenceRedirect: false, singleRun: false, + suppressDeprecatedPropertyWarnings: false, programs: null, moduleResolver: '', }; From 46440cec7b8398252cf83af0ce0df476b7b9b5b8 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 23 Feb 2023 21:20:45 -0500 Subject: [PATCH 2/6] Had to recreate the repo to update these snapshots... --- .../snapshots/1-TSESTree-AST.shot | 20 -------- .../snapshots/5-AST-Alignment-AST.shot | 21 +-------- .../snapshots/1-TSESTree-AST.shot | 31 ------------- .../snapshots/5-AST-Alignment-AST.shot | 46 ++++--------------- .../snapshots/1-TSESTree-AST.shot | 30 ------------ .../snapshots/5-AST-Alignment-AST.shot | 31 +------------ 6 files changed, 10 insertions(+), 169 deletions(-) diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/1-TSESTree-AST.shot index ecd91ed23c5..cfc729be3fc 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/1-TSESTree-AST.shot @@ -73,26 +73,6 @@ Program { end: { column: 28, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSAnyKeyword { - type: "TSAnyKeyword", - - range: [97, 100], - loc: { - start: { column: 24, line: 3 }, - end: { column: 27, line: 3 }, - }, - }, - ], - - range: [96, 101], - loc: { - start: { column: 23, line: 3 }, - end: { column: 28, line: 3 }, - }, - }, range: [84, 101], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/5-AST-Alignment-AST.shot index d7ebe47a9bd..82a2a6fb3e4 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/5-AST-Alignment-AST.shot @@ -73,26 +73,7 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type-with-type-paramete }, }, - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSAnyKeyword { -- type: 'TSAnyKeyword', -- -- range: [97, 100], -- loc: { -- start: { column: 24, line: 3 }, -- end: { column: 27, line: 3 }, -- }, -- }, -- ], -- -- range: [96, 101], -- loc: { -- start: { column: 23, line: 3 }, -- end: { column: 28, line: 3 }, -- }, -- }, - typeParameters: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSAnyKeyword { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/1-TSESTree-AST.shot index 453dc72677f..0b34c12b398 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/1-TSESTree-AST.shot @@ -42,7 +42,6 @@ Program { }, qualifier: null, typeArguments: null, - typeParameters: null, range: [89, 100], loc: { @@ -138,36 +137,6 @@ Program { end: { column: 25, line: 4 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "Y", - - range: [125, 126], - loc: { - start: { column: 23, line: 4 }, - end: { column: 24, line: 4 }, - }, - }, - - range: [125, 126], - loc: { - start: { column: 23, line: 4 }, - end: { column: 24, line: 4 }, - }, - }, - ], - - range: [124, 127], - loc: { - start: { column: 22, line: 4 }, - end: { column: 25, line: 4 }, - }, - }, range: [111, 127], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/5-AST-Alignment-AST.shot index 3c3c8c23b2f..7decc408404 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/5-AST-Alignment-AST.shot @@ -30,18 +30,18 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type AST Alignment - AS - type: 'Literal', - raw: '\\\\'A\\\\'', - value: 'A', -+ argument: Literal { -+ type: 'Literal', -+ raw: '\\\\'A\\\\'', -+ value: 'A', - +- - range: [96, 99], - loc: { - start: { column: 23, line: 3 }, - end: { column: 26, line: 3 }, - }, - }, -- ++ argument: Literal { ++ type: 'Literal', ++ raw: '\\\\'A\\\\'', ++ value: 'A', + range: [96, 99], loc: { start: { column: 23, line: 3 }, @@ -50,7 +50,6 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type AST Alignment - AS }, - qualifier: null, - typeArguments: null, -- typeParameters: null, range: [89, 100], loc: { @@ -118,39 +117,10 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type AST Alignment - AS loc: { start: { column: 21, line: 4 }, end: { column: 22, line: 4 }, -- }, -- }, -- typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'Y', -- -- range: [125, 126], -- loc: { -- start: { column: 23, line: 4 }, -- end: { column: 24, line: 4 }, -- }, -- }, -- -- range: [125, 126], -- loc: { -- start: { column: 23, line: 4 }, -- end: { column: 24, line: 4 }, -- }, -- }, -- ], -- -- range: [124, 127], -- loc: { -- start: { column: 22, line: 4 }, -- end: { column: 25, line: 4 }, }, }, - typeParameters: TSTypeParameterInstantiation { +- typeArguments: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/1-TSESTree-AST.shot index b65621e0c46..6368168abd7 100644 --- a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/1-TSESTree-AST.shot @@ -62,36 +62,6 @@ Program { end: { column: 18, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - name: "B", - - range: [89, 90], - loc: { - start: { column: 16, line: 3 }, - end: { column: 17, line: 3 }, - }, - }, - - range: [89, 90], - loc: { - start: { column: 16, line: 3 }, - end: { column: 17, line: 3 }, - }, - }, - ], - - range: [88, 91], - loc: { - start: { column: 15, line: 3 }, - end: { column: 18, line: 3 }, - }, - }, range: [83, 93], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot index 47fd19df7a9..02dafe0e054 100644 --- a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot @@ -37,36 +37,7 @@ exports[`AST Fixtures legacy-fixtures expressions new-expression-type-arguments }, }, - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- name: 'B', -- -- range: [89, 90], -- loc: { -- start: { column: 16, line: 3 }, -- end: { column: 17, line: 3 }, -- }, -- }, -- -- range: [89, 90], -- loc: { -- start: { column: 16, line: 3 }, -- end: { column: 17, line: 3 }, -- }, -- }, -- ], -- -- range: [88, 91], -- loc: { -- start: { column: 15, line: 3 }, -- end: { column: 18, line: 3 }, -- }, -- }, - typeParameters: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { From ed9a205ffe302af40b265b58fea2d25f725a88d2 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sat, 25 Feb 2023 00:54:16 -0500 Subject: [PATCH 3/6] Apparently fixed warnings --- packages/typescript-estree/src/convert.ts | 65 ++++++++++++----------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 279ff2f4b68..a8423a33e96 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -1672,33 +1672,39 @@ export class Converter { const result = this.createNode< TSESTree.ClassDeclaration | TSESTree.ClassExpression - >(node, { - type: classNodeType, - abstract: hasModifier(SyntaxKind.AbstractKeyword, node), - body: this.createNode(node, { - type: AST_NODE_TYPES.ClassBody, - body: node.members - .filter(isESTreeClassMember) - .map(el => this.convertChild(el)), - range: [node.members.pos - 1, node.end], - }), - declare: hasModifier(SyntaxKind.DeclareKeyword, node), - decorators: - getDecorators(node)?.map(el => this.convertChild(el)) ?? [], - id: this.convertChild(node.name), - implements: - implementsClause?.types.map(el => this.convertChild(el)) ?? [], - superClass: superClass?.types[0] - ? this.convertChild(superClass.types[0].expression) - : null, - superTypeArguments: undefined, - superTypeParameters: undefined, - typeParameters: - node.typeParameters && - this.convertTSTypeParametersToTypeParametersDeclaration( - node.typeParameters, - ), - }); + >( + node, + this.#withDeprecatedAliasGetter( + { + type: classNodeType, + abstract: hasModifier(SyntaxKind.AbstractKeyword, node), + body: this.createNode(node, { + type: AST_NODE_TYPES.ClassBody, + body: node.members + .filter(isESTreeClassMember) + .map(el => this.convertChild(el)), + range: [node.members.pos - 1, node.end], + }), + declare: hasModifier(SyntaxKind.DeclareKeyword, node), + decorators: + getDecorators(node)?.map(el => this.convertChild(el)) ?? [], + id: this.convertChild(node.name), + implements: + implementsClause?.types.map(el => this.convertChild(el)) ?? [], + superClass: superClass?.types[0] + ? this.convertChild(superClass.types[0].expression) + : null, + superTypeArguments: undefined, + typeParameters: + node.typeParameters && + this.convertTSTypeParametersToTypeParametersDeclaration( + node.typeParameters, + ), + }, + 'superTypeParameters', + 'superTypeArguments', + ), + ); if (superClass) { if (superClass.types.length > 1) { @@ -1715,11 +1721,6 @@ export class Converter { superClass.types[0].typeArguments, superClass.types[0], ); - this.#withDeprecatedAliasGetter( - result, - 'superTypeParameters', - 'superTypeArguments', - ); } } From 3ceb7f9d9e9fee7d331b0e30958d26a3ff6cb28f Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sat, 25 Feb 2023 03:17:07 -0500 Subject: [PATCH 4/6] Added nice FAQ article --- docs/linting/Troubleshooting.mdx | 26 +++++++++++++++++++ packages/typescript-estree/src/convert.ts | 2 +- .../tests/lib/convert.test.ts | 2 +- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/docs/linting/Troubleshooting.mdx b/docs/linting/Troubleshooting.mdx index cb59af28447..4bd054ee39e 100644 --- a/docs/linting/Troubleshooting.mdx +++ b/docs/linting/Troubleshooting.mdx @@ -246,6 +246,32 @@ See [this issue comment](https://github.com/typescript-eslint/typescript-eslint/ See [Changes to one file are not reflected in linting other files in my IDE](#changes-to-one-file-are-not-reflected-in-linting-other-files-in-my-ide). Rules such as [`no-unsafe-argument`](https://typescript-eslint.io/rules/no-unsafe-argument), [`no-unsafe-assignment`](https://typescript-eslint.io/rules/no-unsafe-assignment), and [`no-unsafe-call`](https://typescript-eslint.io/rules/no-unsafe-call) are often impacted. +## "The '``' property is deprecated on '``' nodes. Use '``' instead." warnings + +If you're seeing this warning, it's likely you're using an ESLint plugin (or other tooling) that hasn't been updated for typescript-eslint v6. +Make sure you're using the latest versions of each of your ESLint plugins (and other tooling). + +If you've using many ESLint plugins, have updated each to their latest version, and you're not sure which one this complaint is coming from, try disabling half of them at a time to narrow down which plugin it is. +Then make sure each of those plugins has a GitHub issue asking that they release a version supporting typescript-eslint v6. + +:::tip +For developers updating ESLint rules in plugins that still need to support typescript-eslint v5: you may need to `||` fall back to the old property key if the new one doesn't exist: + +```diff +- node.typeParameters ++ node.typeArguments || node.typeParameters +``` + +::: + +For more context, see the [Some properties named typeParameters instead of typeArguments](https://github.com/typescript-eslint/typescript-eslint/issues/146) issue, and the implementing [fix: rename typeParameters to typeArguments where needed](https://github.com/typescript-eslint/typescript-eslint/pull/5384) pull request. + +The [typescript-eslint v6 release post](https://deploy-preview-6515--typescript-eslint.netlify.app/blog/announcing-typescript-eslint-v6-beta) has more information on typescript-eslint v6. + ## My linting feels really slow If you think you're having issues with performance, see our [Performance Troubleshooting documentation](./troubleshooting/Performance.md). + +``` + +``` diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index a8423a33e96..d083a26dd1d 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -3070,7 +3070,7 @@ export class Converter { if (!errored) { // eslint-disable-next-line no-console console.warn( - `The '${aliasKey}' property is deprecated on ${node.type} nodes. Use '${valueKey}' instead.`, + `The '${aliasKey}' property is deprecated on ${node.type} nodes. Use '${valueKey}' instead. See https://typescript-eslint.io/linting/troubleshooting#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.`, ); errored = true; } diff --git a/packages/typescript-estree/tests/lib/convert.test.ts b/packages/typescript-estree/tests/lib/convert.test.ts index 4f32a3f41d6..1eeb95e1f85 100644 --- a/packages/typescript-estree/tests/lib/convert.test.ts +++ b/packages/typescript-estree/tests/lib/convert.test.ts @@ -270,7 +270,7 @@ describe('convert', () => { esCallExpression.typeParameters; expect(warn).toHaveBeenCalledWith( - `The 'typeParameters' property is deprecated on CallExpression nodes. Use 'typeArguments' instead.`, + `The 'typeParameters' property is deprecated on CallExpression nodes. Use 'typeArguments' instead. See https://typescript-eslint.io/linting/troubleshooting#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.`, ); }); From be8adcf0aefd551a4704bfd182e12337f76c030f Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sun, 5 Mar 2023 20:00:54 +1030 Subject: [PATCH 5/6] Update Troubleshooting.mdx --- docs/linting/Troubleshooting.mdx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/linting/Troubleshooting.mdx b/docs/linting/Troubleshooting.mdx index 4bd054ee39e..6d6e14985b1 100644 --- a/docs/linting/Troubleshooting.mdx +++ b/docs/linting/Troubleshooting.mdx @@ -271,7 +271,3 @@ The [typescript-eslint v6 release post](https://deploy-preview-6515--typescript- ## My linting feels really slow If you think you're having issues with performance, see our [Performance Troubleshooting documentation](./troubleshooting/Performance.md). - -``` - -``` From 9a8066f704e63318128f74e3990c54e85b0e7447 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Mon, 13 Mar 2023 01:51:30 -0400 Subject: [PATCH 6/6] Updated snapshots --- .../snapshots/1-TSESTree-AST.shot | 20 ------ .../snapshots/5-AST-Alignment-AST.shot | 23 +----- .../snapshots/1-TSESTree-AST.shot | 32 --------- .../snapshots/5-AST-Alignment-AST.shot | 33 +-------- .../snapshots/1-TSESTree-AST.shot | 53 -------------- .../snapshots/5-AST-Alignment-AST.shot | 56 +-------------- .../snapshots/1-TSESTree-AST.shot | 32 --------- .../snapshots/5-AST-Alignment-AST.shot | 33 +-------- .../snapshots/1-TSESTree-AST.shot | 64 ----------------- .../snapshots/5-AST-Alignment-AST.shot | 70 ++----------------- 10 files changed, 10 insertions(+), 406 deletions(-) diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/1-TSESTree-AST.shot index 192aa4aab46..de282f9ef35 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/1-TSESTree-AST.shot @@ -64,26 +64,6 @@ Program { end: { column: 29, line: 1 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSStringKeyword { - type: "TSStringKeyword", - - range: [22, 28], - loc: { - start: { column: 22, line: 1 }, - end: { column: 28, line: 1 }, - }, - }, - ], - - range: [21, 29], - loc: { - start: { column: 21, line: 1 }, - end: { column: 29, line: 1 }, - }, - }, range: [0, 32], loc: { diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/5-AST-Alignment-AST.shot index 048d8b479ca..64ff14cbc80 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/5-AST-Alignment-AST.shot @@ -46,29 +46,10 @@ exports[`AST Fixtures declaration ClassDeclaration extends-type-param AST Alignm loc: { start: { column: 18, line: 1 }, end: { column: 21, line: 1 }, -- }, -- }, -- superTypeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSStringKeyword { -- type: 'TSStringKeyword', -- -- range: [22, 28], -- loc: { -- start: { column: 22, line: 1 }, -- end: { column: 28, line: 1 }, -- }, -- }, -- ], -- -- range: [21, 29], -- loc: { -- start: { column: 21, line: 1 }, -- end: { column: 29, line: 1 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { +- superTypeArguments: TSTypeParameterInstantiation { ++ superTypeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSStringKeyword { diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/1-TSESTree-AST.shot index 1b34f609f86..19f9bd04352 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/1-TSESTree-AST.shot @@ -76,38 +76,6 @@ Program { end: { column: 27, line: 1 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - decorators: Array [], - name: "T", - optional: false, - - range: [25, 26], - loc: { - start: { column: 25, line: 1 }, - end: { column: 26, line: 1 }, - }, - }, - - range: [25, 26], - loc: { - start: { column: 25, line: 1 }, - end: { column: 26, line: 1 }, - }, - }, - ], - - range: [24, 27], - loc: { - start: { column: 24, line: 1 }, - end: { column: 27, line: 1 }, - }, - }, typeParameters: TSTypeParameterDeclaration { type: "TSTypeParameterDeclaration", params: Array [ diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/5-AST-Alignment-AST.shot index 823f0eeca30..e00a7be7bf6 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/5-AST-Alignment-AST.shot @@ -49,38 +49,7 @@ exports[`AST Fixtures declaration ClassDeclaration type-parameters-extends-type- }, }, - superTypeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'T', -- optional: false, -- -- range: [25, 26], -- loc: { -- start: { column: 25, line: 1 }, -- end: { column: 26, line: 1 }, -- }, -- }, -- -- range: [25, 26], -- loc: { -- start: { column: 25, line: 1 }, -- end: { column: 26, line: 1 }, -- }, -- }, -- ], -- -- range: [24, 27], -- loc: { -- start: { column: 24, line: 1 }, -- end: { column: 27, line: 1 }, -- }, -- }, - superTypeParameters: TSTypeParameterInstantiation { ++ superTypeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/1-TSESTree-AST.shot index 00c4174cb44..b7438a0807d 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/1-TSESTree-AST.shot @@ -97,59 +97,6 @@ Program { end: { column: 40, line: 3 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - decorators: Array [], - name: "C", - optional: false, - - range: [108, 109], - loc: { - start: { column: 35, line: 3 }, - end: { column: 36, line: 3 }, - }, - }, - - range: [108, 109], - loc: { - start: { column: 35, line: 3 }, - end: { column: 36, line: 3 }, - }, - }, - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - decorators: Array [], - name: "D", - optional: false, - - range: [111, 112], - loc: { - start: { column: 38, line: 3 }, - end: { column: 39, line: 3 }, - }, - }, - - range: [111, 112], - loc: { - start: { column: 38, line: 3 }, - end: { column: 39, line: 3 }, - }, - }, - ], - - range: [107, 113], - loc: { - start: { column: 34, line: 3 }, - end: { column: 40, line: 3 }, - }, - }, typeParameters: TSTypeParameterDeclaration { type: "TSTypeParameterDeclaration", params: Array [ diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/5-AST-Alignment-AST.shot index 526a7b1c98d..a0e4a36150f 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/5-AST-Alignment-AST.shot @@ -46,62 +46,10 @@ exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic-multiple loc: { start: { column: 31, line: 3 }, end: { column: 34, line: 3 }, -- }, -- }, -- superTypeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'C', -- optional: false, -- -- range: [108, 109], -- loc: { -- start: { column: 35, line: 3 }, -- end: { column: 36, line: 3 }, -- }, -- }, -- -- range: [108, 109], -- loc: { -- start: { column: 35, line: 3 }, -- end: { column: 36, line: 3 }, -- }, -- }, -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'D', -- optional: false, -- -- range: [111, 112], -- loc: { -- start: { column: 38, line: 3 }, -- end: { column: 39, line: 3 }, -- }, -- }, -- -- range: [111, 112], -- loc: { -- start: { column: 38, line: 3 }, -- end: { column: 39, line: 3 }, -- }, -- }, -- ], -- -- range: [107, 113], -- loc: { -- start: { column: 34, line: 3 }, -- end: { column: 40, line: 3 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { +- superTypeArguments: TSTypeParameterInstantiation { ++ superTypeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/1-TSESTree-AST.shot index 65e2976d5a5..95595f15b73 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/1-TSESTree-AST.shot @@ -76,38 +76,6 @@ Program { end: { column: 27, line: 3 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - decorators: Array [], - name: "B", - optional: false, - - range: [98, 99], - loc: { - start: { column: 25, line: 3 }, - end: { column: 26, line: 3 }, - }, - }, - - range: [98, 99], - loc: { - start: { column: 25, line: 3 }, - end: { column: 26, line: 3 }, - }, - }, - ], - - range: [97, 100], - loc: { - start: { column: 24, line: 3 }, - end: { column: 27, line: 3 }, - }, - }, typeParameters: TSTypeParameterDeclaration { type: "TSTypeParameterDeclaration", params: Array [ diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/5-AST-Alignment-AST.shot index 2ca28ff707f..f5dd08fb20a 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/5-AST-Alignment-AST.shot @@ -49,38 +49,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic AST Alig }, }, - superTypeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'B', -- optional: false, -- -- range: [98, 99], -- loc: { -- start: { column: 25, line: 3 }, -- end: { column: 26, line: 3 }, -- }, -- }, -- -- range: [98, 99], -- loc: { -- start: { column: 25, line: 3 }, -- end: { column: 26, line: 3 }, -- }, -- }, -- ], -- -- range: [97, 100], -- loc: { -- start: { column: 24, line: 3 }, -- end: { column: 27, line: 3 }, -- }, -- }, - superTypeParameters: TSTypeParameterInstantiation { ++ superTypeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/1-TSESTree-AST.shot index a4f850ffacc..e6afbeb0ad9 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/1-TSESTree-AST.shot @@ -76,38 +76,6 @@ Program { end: { column: 67, line: 3 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - decorators: Array [], - name: "A", - optional: false, - - range: [128, 129], - loc: { - start: { column: 55, line: 3 }, - end: { column: 56, line: 3 }, - }, - }, - - range: [128, 129], - loc: { - start: { column: 55, line: 3 }, - end: { column: 56, line: 3 }, - }, - }, - ], - - range: [117, 140], - loc: { - start: { column: 44, line: 3 }, - end: { column: 67, line: 3 }, - }, - }, typeParameters: TSTypeParameterDeclaration { type: "TSTypeParameterDeclaration", params: Array [ @@ -221,38 +189,6 @@ Program { end: { column: 36, line: 6 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - decorators: Array [], - name: "A", - optional: false, - - range: [219, 220], - loc: { - start: { column: 24, line: 6 }, - end: { column: 25, line: 6 }, - }, - }, - - range: [219, 220], - loc: { - start: { column: 24, line: 6 }, - end: { column: 25, line: 6 }, - }, - }, - ], - - range: [208, 231], - loc: { - start: { column: 13, line: 6 }, - end: { column: 36, line: 6 }, - }, - }, typeParameters: TSTypeParameterDeclaration { type: "TSTypeParameterDeclaration", params: Array [ diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/5-AST-Alignment-AST.shot index 6bfd02e2d6d..9dae0c1c3cf 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/5-AST-Alignment-AST.shot @@ -46,41 +46,10 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A loc: { start: { column: 41, line: 3 }, end: { column: 44, line: 3 }, -- }, -- }, -- superTypeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'A', -- optional: false, -- -- range: [128, 129], -- loc: { -- start: { column: 55, line: 3 }, -- end: { column: 56, line: 3 }, -- }, -- }, -- -- range: [128, 129], -- loc: { -- start: { column: 55, line: 3 }, -- end: { column: 56, line: 3 }, -- }, -- }, -- ], -- -- range: [117, 140], -- loc: { -- start: { column: 44, line: 3 }, -- end: { column: 67, line: 3 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { +- superTypeArguments: TSTypeParameterInstantiation { ++ superTypeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -192,41 +161,10 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A loc: { start: { column: 10, line: 6 }, end: { column: 13, line: 6 }, -- }, -- }, -- superTypeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'A', -- optional: false, -- -- range: [219, 220], -- loc: { -- start: { column: 24, line: 6 }, -- end: { column: 25, line: 6 }, -- }, -- }, -- -- range: [219, 220], -- loc: { -- start: { column: 24, line: 6 }, -- end: { column: 25, line: 6 }, -- }, -- }, -- ], -- -- range: [208, 231], -- loc: { -- start: { column: 13, line: 6 }, -- end: { column: 36, line: 6 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { +- superTypeArguments: TSTypeParameterInstantiation { ++ superTypeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference {