From d3633bbf55b727a62cc85940a15866216903528b Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 19 Mar 2023 09:34:19 -0400 Subject: [PATCH] Always Object.defineProperty --- .../snapshots/1-TSESTree-AST.shot | 20 + .../snapshots/5-AST-Alignment-AST.shot | 55 +-- .../snapshots/1-TSESTree-AST.shot | 20 + .../snapshots/5-AST-Alignment-AST.shot | 55 +-- .../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 | 32 ++ .../snapshots/5-AST-Alignment-AST.shot | 67 ++-- .../snapshots/1-TSESTree-AST.shot | 41 ++ .../snapshots/5-AST-Alignment-AST.shot | 77 ++-- .../snapshots/1-TSESTree-AST.shot | 20 + .../snapshots/5-AST-Alignment-AST.shot | 55 +-- .../snapshots/1-TSESTree-AST.shot | 32 ++ .../snapshots/5-AST-Alignment-AST.shot | 33 +- .../snapshots/1-TSESTree-AST.shot | 268 +++++++++++++ .../snapshots/5-AST-Alignment-AST.shot | 373 ++++++++++++++---- .../snapshots/1-TSESTree-AST.shot | 40 ++ .../snapshots/5-AST-Alignment-AST.shot | 76 ++-- .../snapshots/1-TSESTree-AST.shot | 20 + .../snapshots/5-AST-Alignment-AST.shot | 55 +-- .../snapshots/1-TSESTree-AST.shot | 29 ++ .../snapshots/5-AST-Alignment-AST.shot | 64 +-- .../snapshots/1-TSESTree-AST.shot | 32 ++ .../snapshots/5-AST-Alignment-AST.shot | 67 ++-- .../snapshots/1-TSESTree-AST.shot | 32 ++ .../snapshots/5-AST-Alignment-AST.shot | 67 ++-- .../snapshots/1-TSESTree-AST.shot | 112 ++++++ .../snapshots/5-AST-Alignment-AST.shot | 162 ++++++-- .../snapshots/1-TSESTree-AST.shot | 33 ++ .../snapshots/5-AST-Alignment-AST.shot | 34 +- .../snapshots/1-TSESTree-AST.shot | 64 +++ .../snapshots/5-AST-Alignment-AST.shot | 82 +++- .../snapshots/1-TSESTree-AST.shot | 32 ++ .../snapshots/5-AST-Alignment-AST.shot | 33 +- .../snapshots/1-TSESTree-AST.shot | 20 + .../snapshots/5-AST-Alignment-AST.shot | 40 +- .../snapshots/1-TSESTree-AST.shot | 52 +++ .../snapshots/5-AST-Alignment-AST.shot | 54 ++- .../snapshots/1-TSESTree-AST.shot | 32 ++ .../snapshots/5-AST-Alignment-AST.shot | 35 +- .../snapshots/1-TSESTree-AST.shot | 52 +++ .../snapshots/5-AST-Alignment-AST.shot | 54 ++- .../snapshots/1-TSESTree-AST.shot | 32 ++ .../snapshots/5-AST-Alignment-AST.shot | 35 +- .../snapshots/1-TSESTree-AST.shot | 20 + .../snapshots/5-AST-Alignment-AST.shot | 55 +-- .../snapshots/1-TSESTree-AST.shot | 44 +++ .../snapshots/5-AST-Alignment-AST.shot | 79 ++-- .../snapshots/1-TSESTree-AST.shot | 128 ++++++ .../snapshots/5-AST-Alignment-AST.shot | 300 +++++++++----- .../snapshots/1-TSESTree-AST.shot | 40 ++ .../snapshots/5-AST-Alignment-AST.shot | 75 ++-- .../snapshots/1-TSESTree-AST.shot | 39 ++ .../snapshots/5-AST-Alignment-AST.shot | 74 ++-- .../snapshots/1-TSESTree-AST.shot | 32 ++ .../snapshots/5-AST-Alignment-AST.shot | 67 ++-- .../snapshots/1-TSESTree-AST.shot | 92 +++++ .../snapshots/5-AST-Alignment-AST.shot | 162 +++++--- .../snapshots/1-TSESTree-AST.shot | 20 + .../snapshots/5-AST-Alignment-AST.shot | 55 +-- .../snapshots/1-TSESTree-AST.shot | 159 ++++++++ .../snapshots/5-AST-Alignment-AST.shot | 352 ++++++++++++----- .../snapshots/1-TSESTree-AST.shot | 32 ++ .../snapshots/5-AST-Alignment-AST.shot | 35 +- packages/typescript-estree/src/convert.ts | 9 +- 67 files changed, 3848 insertions(+), 783 deletions(-) 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 d9de87c19aa4..5927d6dd6bba 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 @@ -78,6 +78,26 @@ Program { end: { column: 34, line: 4 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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 0ab1de91b9ec..10846964c2cb 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 @@ -56,17 +56,38 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-method typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: 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 { +- 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', +- decorators: Array [], + name: 'Promise', +- optional: false, + + range: [139, 146], + loc: { + start: { column: 27, line: 4 }, + end: { column: 34, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSStringKeyword { @@ -84,18 +105,6 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-method loc: { start: { column: 34, line: 4 }, end: { column: 42, line: 4 }, -- }, -- }, -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'Promise', -- optional: false, -- -- range: [139, 146], -- loc: { -- start: { column: 27, line: 4 }, -- end: { column: 34, line: 4 }, }, }, 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 391e52d7197a..66969e78b5f4 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 @@ -78,6 +78,26 @@ Program { end: { column: 26, line: 4 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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 b706fb052fb7..d19a4504b28f 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 @@ -53,17 +53,38 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-optional-method typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: 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 { +- 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', +- decorators: Array [], + name: 'Promise', +- optional: false, + + range: [131, 138], + loc: { + start: { column: 19, line: 4 }, + end: { column: 26, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSStringKeyword { @@ -83,19 +104,7 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-optional-method end: { column: 34, line: 4 }, }, }, -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'Promise', -- optional: false, -- range: [131, 138], -- loc: { -- start: { column: 19, line: 4 }, -- end: { column: 26, line: 4 }, -- }, -- }, -- range: [131, 146], loc: { start: { column: 19, line: 4 }, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/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 62bd5c01b74f..9d957f2806b6 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 @@ -99,6 +99,59 @@ Program { end: { column: 30, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "S", + 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 }, + }, + }, + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "T", + optional: false, + + 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 9ac4c609f858..5fe8f2ee625b 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 @@ -50,10 +50,62 @@ 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', +- decorators: Array [], +- name: 'S', +- 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 }, +- }, +- }, +- TSTypeReference { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'T', +- optional: false, +- +- 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 }, }, }, -- typeArguments: TSTypeParameterInstantiation { -+ typeParameters: 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 056cda75ff68..fa8719560097 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 @@ -78,6 +78,38 @@ Program { end: { column: 27, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "S", + 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 }, + }, + }, 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 861c924cb00a..f3a4828f755e 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 @@ -53,7 +53,38 @@ exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic AST A }, }, - typeArguments: TSTypeParameterInstantiation { -+ typeParameters: TSTypeParameterInstantiation { +- type: 'TSTypeParameterInstantiation', +- params: Array [ +- TSTypeReference { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'S', +- 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: 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 b9bbc8413430..361680e3c777 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 @@ -128,6 +128,38 @@ Program { end: { column: 32, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "M", + optional: false, + + 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 18e0e9767afd..0139b81df10a 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 @@ -89,17 +89,50 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin-reference AST Alig constraint: TSTypeReference { type: 'TSTypeReference', - typeArguments: 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 { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'M', +- optional: false, +- +- 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', +- decorators: Array [], + name: 'Constructor', +- optional: false, + + range: [94, 105], + loc: { + start: { column: 21, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -131,18 +164,6 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin-reference AST Alig end: { column: 35, line: 3 }, }, }, -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'Constructor', -- optional: false, -- -- range: [94, 105], -- loc: { -- start: { column: 21, line: 3 }, -- end: { column: 32, line: 3 }, -- }, -- }, range: [94, 108], loc: { 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 48529cb0405b..fb010eb1e7e8 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 @@ -163,6 +163,27 @@ Program { end: { column: 32, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeLiteral { + type: "TSTypeLiteral", + members: [], + + 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: { @@ -305,6 +326,26 @@ Program { end: { column: 22, line: 7 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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 4d5c6677152b..33b97612832a 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 @@ -135,17 +135,39 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS constraint: TSTypeReference { type: 'TSTypeReference', - typeArguments: 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 { +- 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', +- decorators: Array [], + name: 'Constructor', +- optional: false, + + range: [94, 105], + loc: { + start: { column: 21, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeLiteral { @@ -164,18 +186,6 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS loc: { start: { column: 32, line: 3 }, end: { column: 36, line: 3 }, -- }, -- }, -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'Constructor', -- optional: false, -- -- range: [94, 105], -- loc: { -- start: { column: 21, line: 3 }, -- end: { column: 32, line: 3 }, }, }, @@ -304,7 +314,26 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS }, optional: false, - typeArguments: TSTypeParameterInstantiation { -+ 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 }, +- }, +- }, + 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 989c307d0982..5839f395f13d 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 @@ -189,6 +189,26 @@ Program { end: { column: 16, line: 6 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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 19856aa2f16c..8b23e6f92c7c 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 @@ -162,17 +162,38 @@ exports[`AST Fixtures legacy-fixtures basics function-with-types-assignation AST typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: 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 { +- 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', +- decorators: Array [], + name: 'Array', +- optional: false, + + range: [139, 144], + loc: { + start: { column: 11, line: 6 }, + end: { column: 16, line: 6 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSStringKeyword { @@ -190,18 +211,6 @@ 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', -- decorators: Array [], -- name: 'Array', -- optional: false, -- -- 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 effb1a6217b2..e5a1948985b6 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 @@ -64,6 +64,38 @@ Program { end: { column: 31, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "J", + optional: false, + + 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 e4ba39d31cbd..c0cb988f2f70 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 @@ -39,7 +39,38 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-extends-type-paramet }, }, - typeArguments: TSTypeParameterInstantiation { -+ typeParameters: TSTypeParameterInstantiation { +- type: 'TSTypeParameterInstantiation', +- params: Array [ +- TSTypeReference { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'J', +- optional: false, +- +- 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 { 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 3529f9cd5de1..7b85fe3846e2 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 @@ -61,6 +61,26 @@ Program { end: { column: 34, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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: { @@ -88,6 +108,78 @@ Program { end: { column: 28, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeArguments: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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", + decorators: [], + name: "Array", + optional: false, + + range: [102, 107], + loc: { + start: { column: 29, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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: { @@ -115,6 +207,182 @@ Program { end: { column: 22, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeArguments: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeArguments: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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", + decorators: [], + name: "Array", + optional: false, + + range: [102, 107], + loc: { + start: { column: 29, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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", + decorators: [], + name: "Array", + optional: false, + + range: [96, 101], + loc: { + start: { column: 23, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeArguments: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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", + decorators: [], + name: "Array", + optional: false, + + range: [102, 107], + loc: { + start: { column: 29, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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 fae5238938d6..81ea3c385c74 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 @@ -24,49 +24,320 @@ exports[`AST Fixtures legacy-fixtures basics nested-type-arguments AST Alignment typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: 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', +- decorators: Array [], +- name: 'Array', +- optional: false, +- +- 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', +- decorators: Array [], +- name: 'Array', +- optional: false, +- +- 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', +- decorators: Array [], +- name: 'Array', +- optional: false, +- +- 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', +- decorators: Array [], + name: 'Array', +- optional: false, + + 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 { -+ 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', +- decorators: Array [], +- name: 'Array', +- optional: false, +- +- 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', +- decorators: Array [], + name: 'Array', +- optional: false, + + 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 { -+ 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 }, +- }, +- }, + typeName: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'Array', +- optional: false, + + range: [102, 107], + loc: { + start: { column: 29, line: 3 }, + end: { column: 34, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSStringKeyword { @@ -86,18 +357,6 @@ exports[`AST Fixtures legacy-fixtures basics nested-type-arguments AST Alignment end: { column: 42, line: 3 }, }, }, -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'Array', -- optional: false, -- -- range: [102, 107], -- loc: { -- start: { column: 29, line: 3 }, -- end: { column: 34, line: 3 }, -- }, -- }, range: [102, 115], loc: { @@ -113,19 +372,7 @@ exports[`AST Fixtures legacy-fixtures basics nested-type-arguments AST Alignment end: { column: 43, line: 3 }, }, }, -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'Array', -- optional: false, -- range: [96, 101], -- loc: { -- start: { column: 23, line: 3 }, -- end: { column: 28, line: 3 }, -- }, -- }, -- range: [96, 116], loc: { start: { column: 23, line: 3 }, @@ -138,18 +385,6 @@ 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', -- decorators: Array [], -- name: 'Array', -- optional: false, -- -- 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 310758701274..1195053e9fbf 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 @@ -51,6 +51,26 @@ Program { end: { column: 8, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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: { @@ -151,6 +171,26 @@ Program { end: { column: 23, line: 4 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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 17bbe4be48f8..455668676a7b 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 @@ -24,17 +24,38 @@ exports[`AST Fixtures legacy-fixtures basics never-type-param AST Alignment - AS typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: 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 { +- 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', +- decorators: Array [], + name: 'X', +- optional: false, + + range: [80, 81], + loc: { + start: { column: 7, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSNeverKeyword { @@ -52,18 +73,6 @@ 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', -- decorators: Array [], -- name: 'X', -- optional: false, -- -- range: [80, 81], -- loc: { -- start: { column: 7, line: 3 }, -- end: { column: 8, line: 3 }, }, }, @@ -147,7 +156,26 @@ exports[`AST Fixtures legacy-fixtures basics never-type-param AST Alignment - AS }, optional: false, - typeArguments: TSTypeParameterInstantiation { -+ 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 }, +- }, +- }, + 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 ede389b531ee..59c9ab44724b 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 @@ -197,6 +197,26 @@ Program { end: { column: 31, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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 37073223f853..1932dc65679e 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 @@ -170,17 +170,38 @@ exports[`AST Fixtures legacy-fixtures basics readonly-arrays AST Alignment - AST typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: 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 { +- 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', +- decorators: Array [], + name: 'ReadonlyArray', +- optional: false, + + range: [91, 104], + loc: { + start: { column: 18, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSStringKeyword { @@ -198,18 +219,6 @@ 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', -- decorators: Array [], -- name: 'ReadonlyArray', -- optional: false, -- -- 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 8214d0f3e51f..0c9786a27271 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 @@ -83,6 +83,35 @@ Program { end: { column: 22, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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 b6d43bac4df8..0f0a99e1336c 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 @@ -47,17 +47,47 @@ exports[`AST Fixtures legacy-fixtures basics symbol-type-param AST Alignment - A typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: 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 { +- 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', +- decorators: Array [], + name: 'Map', +- optional: false, + + range: [92, 95], + loc: { + start: { column: 19, line: 3 }, + end: { column: 22, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSSymbolKeyword { @@ -84,18 +114,6 @@ 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', -- decorators: Array [], -- name: 'Map', -- optional: false, -- -- 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 1dcb35459788..66770e56e60d 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 @@ -68,6 +68,38 @@ Program { end: { column: 35, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "T", + optional: false, + + 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 0ebd18b65e0a..c3f37839122b 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 @@ -29,17 +29,50 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-with-constra TSTypeReference { type: 'TSTypeReference', - typeArguments: 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 { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'T', +- optional: false, +- +- 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', +- decorators: Array [], + name: 'Success', +- optional: false, + + range: [101, 108], + loc: { + start: { column: 28, line: 3 }, + end: { column: 35, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -71,19 +104,7 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-with-constra end: { column: 38, line: 3 }, }, }, -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'Success', -- optional: false, -- 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 7b87092ccd2c..41fc5d23a3d3 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 @@ -68,6 +68,38 @@ Program { end: { column: 24, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "T", + 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 }, + }, + }, 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 d4dec2c54de2..b98aacb72934 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 @@ -29,17 +29,50 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration AST Alignmen TSTypeReference { type: 'TSTypeReference', - typeArguments: 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 { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'T', +- 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 }, +- }, +- }, + typeName: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'Success', +- optional: false, + + range: [90, 97], + loc: { + start: { column: 17, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -71,19 +104,7 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration AST Alignmen end: { column: 27, line: 3 }, }, }, -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'Success', -- optional: false, -- 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 eafcb69bdf0c..3a5768890533 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 @@ -78,6 +78,26 @@ Program { end: { column: 28, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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: { @@ -105,6 +125,98 @@ Program { end: { column: 10, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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", + decorators: [], + name: "B", + optional: false, + + range: [95, 96], + loc: { + start: { column: 22, line: 3 }, + end: { column: 23, line: 3 }, + }, + }, + typeArguments: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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: [ + 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 7a44f8974008..5f954386a854 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 @@ -26,17 +26,110 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type-with-type-paramete typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: 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 { +- 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', +- decorators: Array [], +- name: 'B', +- optional: false, +- +- 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', +- decorators: Array [], + name: 'A', +- optional: false, + + range: [82, 83], + loc: { + start: { column: 9, line: 3 }, + end: { column: 10, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSImportType { @@ -47,18 +140,18 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type-with-type-paramete - type: 'Literal', - raw: '\\'\\'', - value: '', -+ argument: Literal { -+ type: 'Literal', -+ raw: '\\'\\'', -+ value: '', - +- - range: [91, 93], - loc: { - start: { column: 18, line: 3 }, - end: { column: 20, line: 3 }, - }, - }, -- ++ argument: Literal { ++ type: 'Literal', ++ raw: '\\'\\'', ++ value: '', + range: [91, 93], loc: { start: { column: 18, line: 3 }, @@ -75,10 +168,29 @@ 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 [ +- 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 }, }, }, -- typeArguments: TSTypeParameterInstantiation { -+ typeParameters: TSTypeParameterInstantiation { + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSAnyKeyword { @@ -111,18 +223,6 @@ 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', -- decorators: Array [], -- name: 'A', -- optional: false, -- -- 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-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 a0dca73c853b..68e1d47860c5 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 @@ -45,6 +45,7 @@ Program { }, qualifier: null, typeArguments: null, + typeParameters: null, range: [89, 100], loc: { @@ -147,6 +148,38 @@ Program { end: { column: 25, line: 4 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "Y", + optional: false, + + 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 62d99f330fd3..fc124d6e2c9f 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 @@ -53,6 +53,7 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type AST Alignment - AS }, - qualifier: null, - typeArguments: null, +- typeParameters: null, range: [89, 100], loc: { @@ -128,7 +129,38 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type AST Alignment - AS }, }, - typeArguments: TSTypeParameterInstantiation { -+ typeParameters: TSTypeParameterInstantiation { +- type: 'TSTypeParameterInstantiation', +- params: Array [ +- TSTypeReference { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'Y', +- optional: false, +- +- 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 { 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 31bc883b677a..b40431b41d52 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 @@ -312,6 +312,38 @@ Program { end: { column: 72, line: 7 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "A", + optional: false, + + 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: { @@ -434,6 +466,38 @@ Program { end: { column: 36, line: 9 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "A", + optional: false, + + 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 a04914b21e16..9ec164706a4f 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 @@ -229,8 +229,7 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A - decorators: Array [], - name: 'A', - optional: false, -+ name: 'A', - +- - range: [168, 169], - loc: { - start: { column: 12, line: 5 }, @@ -238,7 +237,8 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A - }, - }, - out: false, -- ++ name: 'A', + range: [168, 183], loc: { start: { column: 12, line: 5 }, @@ -288,10 +288,41 @@ 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', +- decorators: Array [], +- name: 'A', +- optional: false, +- +- 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 }, }, }, -- typeArguments: TSTypeParameterInstantiation { -+ typeParameters: TSTypeParameterInstantiation { + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -355,8 +386,7 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A - decorators: Array [], - name: 'A', - optional: false, -+ name: 'A', - +- - range: [259, 260], - loc: { - start: { column: 24, line: 7 }, @@ -364,7 +394,8 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A - }, - }, - out: false, -- ++ name: 'A', + range: [259, 260], loc: { start: { column: 24, line: 7 }, @@ -414,10 +445,41 @@ 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', +- decorators: Array [], +- name: 'A', +- optional: false, +- +- 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 }, }, }, -- typeArguments: TSTypeParameterInstantiation { -+ typeParameters: 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 f6120c1dd742..0df81a1d0488 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 @@ -54,6 +54,38 @@ Program { end: { column: 38, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "A", + optional: false, + + 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 212f808e37d5..8c87edf274b9 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 @@ -27,7 +27,38 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments AST Alignm }, optional: false, - typeArguments: TSTypeParameterInstantiation { -+ typeParameters: TSTypeParameterInstantiation { +- type: 'TSTypeParameterInstantiation', +- params: Array [ +- TSTypeReference { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'A', +- optional: false, +- +- 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 { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { 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 18334207c3b0..0c5cf95d90a3 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 @@ -89,6 +89,26 @@ Program { end: { column: 29, line: 4 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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 4af0d045e7b5..0204d7ccc9c1 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 @@ -91,26 +91,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 c12e069a6505..123c16703514 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 @@ -54,6 +54,38 @@ Program { end: { column: 6, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "A", + optional: false, + + 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: { @@ -106,6 +138,26 @@ Program { end: { column: 11, line: 4 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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 b49a2455c85a..90cd92550d8b 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 @@ -27,7 +27,38 @@ exports[`AST Fixtures legacy-fixtures expressions call-expression-type-arguments }, optional: false, - typeArguments: TSTypeParameterInstantiation { -+ typeParameters: TSTypeParameterInstantiation { +- type: 'TSTypeParameterInstantiation', +- params: Array [ +- TSTypeReference { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'A', +- optional: false, +- +- 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 { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -92,7 +123,26 @@ exports[`AST Fixtures legacy-fixtures expressions call-expression-type-arguments }, optional: false, - typeArguments: TSTypeParameterInstantiation { -+ 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 }, +- }, +- }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSNumberKeyword { 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 f34ef6e5f0e3..d2a97b8691d7 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 @@ -69,6 +69,38 @@ Program { end: { column: 18, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "B", + optional: false, + + 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 2786d19fdd3d..ec536369f886 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 @@ -39,10 +39,41 @@ exports[`AST Fixtures legacy-fixtures expressions new-expression-type-arguments loc: { start: { column: 14, line: 3 }, end: { column: 15, line: 3 }, +- }, +- }, +- typeArguments: TSTypeParameterInstantiation { +- type: 'TSTypeParameterInstantiation', +- params: Array [ +- TSTypeReference { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'B', +- optional: false, +- +- 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 }, }, }, -- typeArguments: TSTypeParameterInstantiation { -+ typeParameters: TSTypeParameterInstantiation { + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { 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 38b8c0d7eecd..40f11c3c1dc4 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 @@ -79,6 +79,38 @@ Program { end: { column: 11, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "A", + optional: false, + + 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: { @@ -163,6 +195,26 @@ Program { end: { column: 16, line: 4 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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 e040ed835e20..79b391cda5da 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 @@ -52,7 +52,38 @@ exports[`AST Fixtures legacy-fixtures expressions optional-call-expression-type- }, optional: false, - typeArguments: TSTypeParameterInstantiation { -+ typeParameters: TSTypeParameterInstantiation { +- type: 'TSTypeParameterInstantiation', +- params: Array [ +- TSTypeReference { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'A', +- optional: false, +- +- 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 { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -149,7 +180,26 @@ exports[`AST Fixtures legacy-fixtures expressions optional-call-expression-type- }, optional: false, - typeArguments: TSTypeParameterInstantiation { -+ 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 }, +- }, +- }, + 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 faa9dd7a7f4d..523911bdd6cc 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 @@ -78,6 +78,38 @@ Program { end: { column: 8, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "bar", + optional: false, + + 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 dcf8eb70d961..61e0f9e950f0 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 @@ -48,10 +48,41 @@ exports[`AST Fixtures legacy-fixtures expressions tagged-template-expression-typ loc: { start: { column: 0, line: 3 }, end: { column: 3, line: 3 }, +- }, +- }, +- typeArguments: TSTypeParameterInstantiation { +- type: 'TSTypeParameterInstantiation', +- params: Array [ +- TSTypeReference { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'bar', +- optional: false, +- +- 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 }, }, }, -- typeArguments: TSTypeParameterInstantiation { -+ 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 bc1ef7402cc8..4b1574af1564 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 @@ -98,6 +98,26 @@ Program { end: { column: 53, line: 4 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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 8732ff7462b1..39ad0f238b49 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 @@ -71,17 +71,38 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules declare-namespace-w typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: 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 { +- 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', +- decorators: Array [], + name: 'Selection', +- optional: false, + + range: [140, 149], + loc: { + start: { column: 44, line: 4 }, + end: { column: 53, line: 4 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSAnyKeyword { @@ -101,19 +122,7 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules declare-namespace-w end: { column: 58, line: 4 }, }, }, -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'Selection', -- optional: false, -- range: [140, 149], -- loc: { -- start: { column: 44, line: 4 }, -- end: { column: 53, line: 4 }, -- }, -- }, -- range: [140, 154], loc: { start: { column: 44, line: 4 }, diff --git a/packages/ast-spec/src/legacy-fixtures/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 0a99fe4c889a..5d3f93a6782b 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 @@ -221,6 +221,50 @@ Program { end: { column: 21, line: 7 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSInferType { + type: "TSInferType", + typeParameter: TSTypeParameter { + type: "TSTypeParameter", + const: false, + in: false, + name: Identifier { + type: "Identifier", + decorators: [], + name: "U", + optional: false, + + 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 d24b29499950..7e43a6c1cebe 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 @@ -182,17 +182,62 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignme extendsType: TSTypeReference { type: 'TSTypeReference', - typeArguments: 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 { +- type: 'TSInferType', +- typeParameter: TSTypeParameter { +- type: 'TSTypeParameter', +- const: false, +- in: false, +- name: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'U', +- optional: false, +- +- 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', +- decorators: Array [], + name: 'Promise', +- optional: false, + + range: [162, 169], + loc: { + start: { column: 14, line: 7 }, + end: { column: 21, line: 7 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSInferType { @@ -237,19 +282,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignme end: { column: 30, line: 7 }, }, }, -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'Promise', -- optional: false, -- range: [162, 169], -- loc: { -- start: { column: 14, line: 7 }, -- end: { column: 21, line: 7 }, -- }, -- }, -- range: [162, 178], loc: { start: { column: 14, 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 d2240994ff9e..3bc56835a33f 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 @@ -150,6 +150,38 @@ Program { end: { column: 62, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "U", + optional: false, + + 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,6 +426,38 @@ Program { end: { column: 16, line: 5 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "U", + optional: false, + + 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: { @@ -629,6 +693,38 @@ Program { end: { column: 16, line: 8 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "U", + optional: false, + + 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: { @@ -864,6 +960,38 @@ Program { end: { column: 16, line: 11 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "U", + optional: false, + + 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 1b714bc69893..f4f1323cdf58 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 @@ -69,7 +69,8 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS - decorators: Array [], - name: 'U', - optional: false, -- ++ name: 'U', + - range: [103, 104], - loc: { - start: { column: 30, line: 3 }, @@ -77,8 +78,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS - }, - }, - out: false, -+ name: 'U', - +- range: [103, 119], loc: { start: { column: 30, line: 3 }, @@ -112,17 +112,50 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS trueType: TSTypeReference { type: 'TSTypeReference', - typeArguments: 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 { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'U', +- optional: false, +- +- 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', +- decorators: Array [], + name: 'MustBeNumber', +- optional: false, + + range: [123, 135], + loc: { + start: { column: 50, line: 3 }, + end: { column: 62, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -152,18 +185,6 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS loc: { start: { column: 62, line: 3 }, end: { column: 65, line: 3 }, -- }, -- }, -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'MustBeNumber', -- optional: false, -- -- range: [123, 135], -- loc: { -- start: { column: 50, line: 3 }, -- end: { column: 62, line: 3 }, }, }, @@ -192,7 +213,8 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS - decorators: Array [], - name: 'T', - optional: false, -- ++ name: 'T', + - range: [81, 82], - loc: { - start: { column: 8, line: 3 }, @@ -200,8 +222,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS - }, - }, - out: false, -+ name: 'T', - +- range: [81, 82], loc: { start: { column: 8, line: 3 }, @@ -370,17 +391,50 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS trueType: TSTypeReference { type: 'TSTypeReference', - typeArguments: 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 { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'U', +- optional: false, +- +- 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', +- decorators: Array [], + name: 'MustBeNumber', +- optional: false, + + range: [224, 236], + loc: { + start: { column: 4, line: 5 }, + end: { column: 16, line: 5 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -412,19 +466,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS end: { column: 19, line: 5 }, }, }, -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'MustBeNumber', -- optional: false, -- range: [224, 236], -- loc: { -- start: { column: 4, line: 5 }, -- end: { column: 16, line: 5 }, -- }, -- }, -- range: [224, 239], loc: { start: { column: 4, line: 5 }, @@ -450,8 +492,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS - decorators: Array [], - name: 'T', - optional: false, -+ name: 'T', - +- - range: [156, 157], - loc: { - start: { column: 8, line: 4 }, @@ -459,7 +500,8 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS - }, - }, - out: false, -- ++ name: 'T', + range: [156, 157], loc: { start: { column: 8, line: 4 }, @@ -542,7 +584,8 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS - decorators: Array [], - name: 'U', - optional: false, -- ++ name: 'U', + - range: [281, 282], - loc: { - start: { column: 30, line: 7 }, @@ -550,8 +593,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS - }, - }, - out: false, -+ name: 'U', - +- range: [281, 297], loc: { start: { column: 30, line: 7 }, @@ -619,17 +661,50 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS trueType: TSTypeReference { type: 'TSTypeReference', - typeArguments: 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 { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'U', +- optional: false, +- +- 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', +- decorators: Array [], + name: 'MustBeNumber', +- optional: false, + + range: [312, 324], + loc: { + start: { column: 4, line: 8 }, + end: { column: 16, line: 8 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -659,18 +734,6 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS loc: { start: { column: 16, line: 8 }, end: { column: 19, line: 8 }, -- }, -- }, -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'MustBeNumber', -- optional: false, -- -- range: [312, 324], -- loc: { -- start: { column: 4, line: 8 }, -- end: { column: 16, line: 8 }, }, }, @@ -868,17 +931,50 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS trueType: TSTypeReference { type: 'TSTypeReference', - typeArguments: 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 { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'U', +- optional: false, +- +- 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', +- decorators: Array [], + name: 'MustBeNumber', +- optional: false, + + range: [400, 412], + loc: { + start: { column: 4, line: 11 }, + end: { column: 16, line: 11 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -908,18 +1004,6 @@ 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', -- decorators: Array [], -- name: 'MustBeNumber', -- optional: false, -- -- range: [400, 412], -- loc: { -- start: { column: 4, line: 11 }, -- end: { column: 16, line: 11 }, }, }, @@ -1032,8 +1116,8 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS loc: { start: { column: 40, line: 13 }, end: { column: 46, line: 13 }, - }, - }, +- }, +- }, - in: false, - name: Identifier { - type: 'Identifier', @@ -1045,8 +1129,8 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS - loc: { - start: { column: 30, line: 13 }, - end: { column: 31, line: 13 }, -- }, -- }, + }, + }, - out: false, + name: 'U', 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 5d1733dfb27b..7b270bbeb669 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 @@ -71,6 +71,46 @@ Program { end: { column: 12, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSConstructorType { + type: "TSConstructorType", + abstract: false, + params: [], + 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 bccbac1b833b..5432fcbc649a 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 @@ -24,17 +24,58 @@ exports[`AST Fixtures legacy-fixtures types constructor-in-generic AST Alignment typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: 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 { +- 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', +- decorators: Array [], + name: 'Array', +- optional: false, + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSConstructorType { @@ -76,19 +117,7 @@ exports[`AST Fixtures legacy-fixtures types constructor-in-generic AST Alignment end: { column: 30, line: 3 }, }, }, -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'Array', -- optional: false, -- range: [80, 85], -- loc: { -- start: { column: 7, line: 3 }, -- end: { column: 12, line: 3 }, -- }, -- }, -- range: [80, 103], loc: { start: { column: 7, 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 70a3a44d61aa..437f52c943c1 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 @@ -70,6 +70,45 @@ Program { end: { column: 12, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSFunctionType { + type: "TSFunctionType", + params: [], + 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 bf666f461df8..97aa0da4e4c5 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 @@ -24,17 +24,57 @@ exports[`AST Fixtures legacy-fixtures types function-in-generic AST Alignment - typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: 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 { +- 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', +- decorators: Array [], + name: 'Array', +- optional: false, + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSFunctionType { @@ -75,19 +115,7 @@ exports[`AST Fixtures legacy-fixtures types function-in-generic AST Alignment - end: { column: 24, line: 3 }, }, }, -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'Array', -- optional: false, -- range: [80, 85], -- loc: { -- start: { column: 7, line: 3 }, -- end: { column: 12, line: 3 }, -- }, -- }, -- range: [80, 97], loc: { start: { column: 7, 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 2b505af45b4d..8eddb7279d47 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 @@ -112,6 +112,38 @@ Program { end: { column: 43, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "T", + optional: false, + + 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 21aa48fbc9af..70bd82e2ce5c 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 @@ -73,17 +73,50 @@ exports[`AST Fixtures legacy-fixtures types intersection-type AST Alignment - AS typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: 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 { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'T', +- optional: false, +- +- 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', +- decorators: Array [], + name: 'LinkedList', +- optional: false, + + range: [106, 116], + loc: { + start: { column: 33, line: 3 }, + end: { column: 43, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -113,18 +146,6 @@ exports[`AST Fixtures legacy-fixtures types intersection-type AST Alignment - AS loc: { start: { column: 43, line: 3 }, end: { column: 46, line: 3 }, -- }, -- }, -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'LinkedList', -- optional: false, -- -- range: [106, 116], -- loc: { -- start: { column: 33, line: 3 }, -- end: { column: 43, 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 19b7f5d47af7..bf02a343a25a 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 @@ -56,6 +56,26 @@ Program { end: { column: 18, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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: { @@ -83,6 +103,78 @@ Program { end: { column: 12, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeArguments: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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", + decorators: [], + name: "Array", + optional: false, + + range: [86, 91], + loc: { + start: { column: 13, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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 1d1e3d2d4774..103c30963818 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 @@ -24,33 +24,127 @@ exports[`AST Fixtures legacy-fixtures types reference-generic-nested AST Alignme typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: 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', +- decorators: Array [], +- name: 'Array', +- optional: false, +- +- 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', +- decorators: Array [], + name: 'Array', +- optional: false, + + 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 { -+ 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 }, +- }, +- }, + typeName: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'Array', +- optional: false, + + range: [86, 91], + loc: { + start: { column: 13, line: 3 }, + end: { column: 18, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSNumberKeyword { @@ -70,18 +164,6 @@ exports[`AST Fixtures legacy-fixtures types reference-generic-nested AST Alignme end: { column: 26, line: 3 }, }, }, -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'Array', -- optional: false, -- -- range: [86, 91], -- loc: { -- start: { column: 13, line: 3 }, -- end: { column: 18, line: 3 }, -- }, -- }, range: [86, 99], loc: { @@ -97,18 +179,6 @@ exports[`AST Fixtures legacy-fixtures types reference-generic-nested AST Alignme end: { column: 27, line: 3 }, }, }, -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'Array', -- optional: false, -- -- range: [80, 85], -- loc: { -- start: { column: 7, line: 3 }, -- end: { column: 12, line: 3 }, -- }, -- }, range: [80, 100], loc: { 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 21655befda9d..95bc08aad631 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 @@ -51,6 +51,26 @@ Program { end: { column: 12, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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 ef82ec276a6b..d154684870ed 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 @@ -24,17 +24,38 @@ exports[`AST Fixtures legacy-fixtures types reference-generic AST Alignment - AS typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: 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 { +- 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', +- decorators: Array [], + name: 'Array', +- optional: false, + + range: [80, 85], + loc: { + start: { column: 7, line: 3 }, + end: { column: 12, line: 3 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSNumberKeyword { @@ -54,19 +75,7 @@ exports[`AST Fixtures legacy-fixtures types reference-generic AST Alignment - AS end: { column: 20, line: 3 }, }, }, -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'Array', -- optional: false, -- range: [80, 85], -- loc: { -- start: { column: 7, line: 3 }, -- end: { column: 12, line: 3 }, -- }, -- }, -- range: [80, 93], loc: { start: { column: 7, 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 08cdee8255cd..e3d50cc96569 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 @@ -140,6 +140,38 @@ Program { end: { column: 14, line: 4 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "T", + optional: false, + + 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: { @@ -193,6 +225,38 @@ Program { end: { column: 32, line: 4 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "T", + optional: false, + + 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: { @@ -246,6 +310,38 @@ Program { end: { column: 51, line: 4 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "T", + optional: false, + + 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: { @@ -299,6 +395,38 @@ Program { end: { column: 72, line: 4 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "T", + optional: false, + + 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: { @@ -425,6 +553,37 @@ Program { end: { column: 33, line: 5 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + 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 1b0760380972..6cea58bdf146 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 @@ -33,17 +33,7 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen - 'cooked': '', - 'raw': '', - }, -+ typeAnnotation: TSLiteralType { -+ type: 'TSLiteralType', -+ literal: TemplateLiteral { -+ type: 'TemplateLiteral', -+ expressions: Array [ -+ TSTypeReference { -+ type: 'TSTypeReference', -+ typeName: Identifier { -+ type: 'Identifier', -+ name: 'Uppercase', - +- - range: [121, 124], - loc: { - start: { column: 2, line: 4 }, @@ -57,20 +47,16 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen - 'cooked': ' - ', - 'raw': ' - ', - }, -+ range: [124, 133], -+ loc: { -+ start: { column: 5, line: 4 }, -+ end: { column: 14, line: 4 }, -+ }, -+ }, -+ typeParameters: TSTypeParameterInstantiation { -+ type: 'TSTypeParameterInstantiation', -+ params: Array [ -+ TSTypeReference { -+ type: 'TSTypeReference', -+ typeName: Identifier { -+ type: 'Identifier', -+ name: 'T', ++ typeAnnotation: TSLiteralType { ++ type: 'TSLiteralType', ++ literal: TemplateLiteral { ++ type: 'TemplateLiteral', ++ expressions: Array [ ++ TSTypeReference { ++ type: 'TSTypeReference', ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Uppercase', - range: [136, 142], - loc: { @@ -113,7 +99,21 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen - 'cooked': '', - 'raw': '', - }, -- ++ range: [124, 133], ++ loc: { ++ start: { column: 5, line: 4 }, ++ end: { column: 14, line: 4 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { ++ type: 'TSTypeParameterInstantiation', ++ params: Array [ ++ TSTypeReference { ++ type: 'TSTypeReference', ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'T', + - range: [194, 196], - loc: { - start: { column: 75, line: 4 }, @@ -160,36 +160,66 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + end: { column: 17, line: 4 }, }, - ], -+ }, - +- - range: [133, 136], -+ range: [124, 136], - loc: { +- loc: { - start: { column: 14, line: 4 }, -+ start: { column: 5, line: 4 }, - end: { column: 17, line: 4 }, +- end: { column: 17, line: 4 }, }, - }, +- }, - typeName: Identifier { - type: 'Identifier', - decorators: Array [], - name: 'Uppercase', - optional: false, + +- 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', +- decorators: Array [], +- name: 'T', +- optional: false, + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'Lowercase', -- range: [124, 133], -- loc: { -- start: { column: 5, line: 4 }, -- end: { column: 14, line: 4 }, +- 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: [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 { @@ -245,36 +275,66 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + end: { column: 35, line: 4 }, }, - ], -+ }, - +- - range: [151, 154], -+ range: [142, 154], - loc: { +- loc: { - start: { column: 32, line: 4 }, -+ start: { column: 23, line: 4 }, - end: { column: 35, line: 4 }, +- end: { column: 35, line: 4 }, }, - }, +- }, - typeName: Identifier { - type: 'Identifier', - decorators: Array [], - name: 'Lowercase', - optional: false, + +- 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', +- decorators: Array [], +- name: 'T', +- optional: false, +- +- range: [152, 153], +- loc: { +- start: { column: 33, line: 4 }, +- end: { column: 34, line: 4 }, +- }, +- }, + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'Capitalize', -- range: [142, 151], -- loc: { -- start: { column: 23, line: 4 }, -- end: { column: 32, line: 4 }, +- range: [152, 153], +- loc: { +- start: { column: 33, line: 4 }, +- end: { column: 34, 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 { @@ -330,36 +390,66 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + end: { column: 54, line: 4 }, }, - ], -+ }, - +- - range: [170, 173], -+ range: [160, 173], - loc: { +- loc: { - start: { column: 51, line: 4 }, -+ start: { column: 41, line: 4 }, - end: { column: 54, line: 4 }, +- end: { column: 54, line: 4 }, }, - }, +- }, - typeName: Identifier { - type: 'Identifier', - decorators: Array [], - name: 'Capitalize', - optional: false, + +- 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', +- decorators: Array [], +- name: 'T', +- optional: false, + TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'Uncapitalize', -- range: [160, 170], -- loc: { -- start: { column: 41, line: 4 }, -- end: { column: 51, line: 4 }, +- 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: [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 { @@ -439,13 +529,26 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + 'cooked': '', + 'raw': '', + }, -+ + +- range: [179, 191], + range: [121, 124], -+ loc: { + loc: { +- start: { column: 60, line: 4 }, +- end: { column: 72, line: 4 }, + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, -+ }, -+ }, + }, + }, +- typeParameters: TSTypeParameterInstantiation { +- type: 'TSTypeParameterInstantiation', +- params: Array [ +- TSTypeReference { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'T', +- optional: false, + TemplateElement { + type: 'TemplateElement', + tail: false, @@ -454,15 +557,18 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + 'raw': ' - ', + }, -- range: [179, 191], +- range: [192, 193], +- loc: { +- start: { column: 73, line: 4 }, +- end: { column: 74, line: 4 }, +- }, +- }, + range: [136, 142], - loc: { -- start: { column: 60, line: 4 }, -- end: { column: 72, line: 4 }, ++ loc: { + start: { column: 17, line: 4 }, + end: { column: 23, line: 4 }, - }, - }, ++ }, ++ }, + TemplateElement { + type: 'TemplateElement', + tail: false, @@ -471,10 +577,13 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + 'raw': ' - ', + }, -- range: [179, 194], -- loc: { -- start: { column: 60, line: 4 }, -- end: { column: 75, line: 4 }, +- range: [192, 193], +- loc: { +- start: { column: 73, line: 4 }, +- end: { column: 74, line: 4 }, +- }, +- }, +- ], + range: [154, 160], + loc: { + start: { column: 35, line: 4 }, @@ -488,13 +597,16 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + 'cooked': ' - ', + 'raw': ' - ', + }, -+ + +- range: [191, 194], + range: [173, 179], -+ loc: { + loc: { +- start: { column: 72, line: 4 }, +- end: { column: 75, line: 4 }, + start: { column: 54, line: 4 }, + end: { column: 60, line: 4 }, -+ }, -+ }, + }, + }, + TemplateElement { + type: 'TemplateElement', + tail: true, @@ -502,7 +614,11 @@ 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 }, @@ -538,8 +654,8 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen loc: { start: { column: 36, line: 3 }, end: { column: 42, line: 3 }, -- }, -- }, + }, + }, - in: false, - name: Identifier { - type: 'Identifier', @@ -551,8 +667,8 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen - loc: { - start: { column: 26, line: 3 }, - end: { column: 27, line: 3 }, - }, - }, +- }, +- }, - out: false, + name: 'T', @@ -595,17 +711,49 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: 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 { +- 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', +- decorators: Array [], + name: 'EnthusiasticGreeting', +- optional: false, + + range: [211, 231], + loc: { + start: { column: 13, line: 5 }, + end: { column: 33, line: 5 }, + }, + }, + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSLiteralType { @@ -634,18 +782,6 @@ 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', -- decorators: Array [], -- name: 'EnthusiasticGreeting', -- optional: false, -- -- 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 7b4638ac81ad..2e4569c85538 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 @@ -84,6 +84,38 @@ Program { end: { column: 20, line: 3 }, }, }, + typeParameters: TSTypeParameterInstantiation { + type: "TSTypeParameterInstantiation", + params: [ + TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + decorators: [], + name: "w", + optional: false, + + 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 4ff83eed65fd..47c46716aab1 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 @@ -54,10 +54,41 @@ exports[`AST Fixtures legacy-fixtures types typeof-with-type-parameters AST Alig loc: { start: { column: 14, line: 3 }, end: { column: 17, line: 3 }, +- }, +- }, +- typeArguments: TSTypeParameterInstantiation { +- type: 'TSTypeParameterInstantiation', +- params: Array [ +- TSTypeReference { +- type: 'TSTypeReference', +- typeName: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'w', +- optional: false, +- +- 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 }, }, }, -- typeArguments: TSTypeParameterInstantiation { -+ typeParameters: TSTypeParameterInstantiation { + typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 4783e954564b..91191d97100a 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -3319,16 +3319,15 @@ export class Converter { aliasKey: AliasKey, valueKey: ValueKey, ): Properties & Record { - if (this.options.suppressDeprecatedPropertyWarnings) { - (node as any)[aliasKey] = node[valueKey]; - return node as Properties & Record; - } - let warned = false; Object.defineProperty(node, aliasKey, { configurable: true, get(): Properties[typeof valueKey] { + if (this.options.suppressDeprecatedPropertyWarnings) { + (node as any)[aliasKey] = node[valueKey]; + } + if (!warned) { // eslint-disable-next-line no-console console.warn(