diff --git a/docs/architecture/TypeScript-ESTree.mdx b/docs/architecture/TypeScript-ESTree.mdx index 98afc46b27d..1df71408595 100644 --- a/docs/architecture/TypeScript-ESTree.mdx +++ b/docs/architecture/TypeScript-ESTree.mdx @@ -42,6 +42,11 @@ interface ParseOptions { */ comment?: boolean; + /** + * Whether deprecated AST properties should skip calling console.warn on accesses. + */ + suppressDeprecatedPropertyWarnings?: boolean; + /** * An array of modules to turn explicit debugging on for. * - 'typescript-eslint' is the same as setting the env var `DEBUG=typescript-eslint:*` diff --git a/docs/linting/Troubleshooting.mdx b/docs/linting/Troubleshooting.mdx index f29eabc12c3..3f49a0781b5 100644 --- a/docs/linting/Troubleshooting.mdx +++ b/docs/linting/Troubleshooting.mdx @@ -246,6 +246,28 @@ See [this issue comment](https://github.com/typescript-eslint/typescript-eslint/ See [Changes to one file are not reflected in linting other files in my IDE](#changes-to-one-file-are-not-reflected-when-linting-other-files-in-my-ide). Rules such as [`no-unsafe-argument`](https://typescript-eslint.io/rules/no-unsafe-argument), [`no-unsafe-assignment`](https://typescript-eslint.io/rules/no-unsafe-assignment), and [`no-unsafe-call`](https://typescript-eslint.io/rules/no-unsafe-call) are often impacted. +## "The '``' property is deprecated on '``' nodes. Use '``' instead." warnings + +If you're seeing this warning, it's likely you're using an ESLint plugin (or other tooling) that hasn't been updated for typescript-eslint v6. +Make sure you're using the latest versions of each of your ESLint plugins (and other tooling). + +If you've using many ESLint plugins, have updated each to their latest version, and you're not sure which one this complaint is coming from, try disabling half of them at a time to narrow down which plugin it is. +Then make sure each of those plugins has a GitHub issue asking that they release a version supporting typescript-eslint v6. + +:::tip +For developers updating ESLint rules in plugins that still need to support typescript-eslint v5: you may need to `||` fall back to the old property key if the new one doesn't exist: + +```diff +- node.typeParameters ++ node.typeArguments || node.typeParameters +``` + +::: + +For more context, see the [Some properties named typeParameters instead of typeArguments](https://github.com/typescript-eslint/typescript-eslint/issues/146) issue, and the implementing [fix: rename typeParameters to typeArguments where needed](https://github.com/typescript-eslint/typescript-eslint/pull/5384) pull request. + +The [typescript-eslint v6 release post](https://deploy-preview-6515--typescript-eslint.netlify.app/blog/announcing-typescript-eslint-v6-beta) has more information on typescript-eslint v6. + ## My linting feels really slow If you think you're having issues with performance, see our [Performance Troubleshooting documentation](./troubleshooting/Performance.md). diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/1-TSESTree-AST.shot index 192aa4aab46..de282f9ef35 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/1-TSESTree-AST.shot @@ -64,26 +64,6 @@ Program { end: { column: 29, line: 1 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSStringKeyword { - type: "TSStringKeyword", - - range: [22, 28], - loc: { - start: { column: 22, line: 1 }, - end: { column: 28, line: 1 }, - }, - }, - ], - - range: [21, 29], - loc: { - start: { column: 21, line: 1 }, - end: { column: 29, line: 1 }, - }, - }, range: [0, 32], loc: { diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/5-AST-Alignment-AST.shot index 048d8b479ca..64ff14cbc80 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/5-AST-Alignment-AST.shot @@ -46,29 +46,10 @@ exports[`AST Fixtures declaration ClassDeclaration extends-type-param AST Alignm loc: { start: { column: 18, line: 1 }, end: { column: 21, line: 1 }, -- }, -- }, -- superTypeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSStringKeyword { -- type: 'TSStringKeyword', -- -- range: [22, 28], -- loc: { -- start: { column: 22, line: 1 }, -- end: { column: 28, line: 1 }, -- }, -- }, -- ], -- -- range: [21, 29], -- loc: { -- start: { column: 21, line: 1 }, -- end: { column: 29, line: 1 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { +- superTypeArguments: TSTypeParameterInstantiation { ++ superTypeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSStringKeyword { diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/1-TSESTree-AST.shot index 1b34f609f86..19f9bd04352 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/1-TSESTree-AST.shot @@ -76,38 +76,6 @@ Program { end: { column: 27, line: 1 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - decorators: Array [], - name: "T", - optional: false, - - range: [25, 26], - loc: { - start: { column: 25, line: 1 }, - end: { column: 26, line: 1 }, - }, - }, - - range: [25, 26], - loc: { - start: { column: 25, line: 1 }, - end: { column: 26, line: 1 }, - }, - }, - ], - - range: [24, 27], - loc: { - start: { column: 24, line: 1 }, - end: { column: 27, line: 1 }, - }, - }, typeParameters: TSTypeParameterDeclaration { type: "TSTypeParameterDeclaration", params: Array [ diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/5-AST-Alignment-AST.shot index 823f0eeca30..e00a7be7bf6 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/5-AST-Alignment-AST.shot @@ -49,38 +49,7 @@ exports[`AST Fixtures declaration ClassDeclaration type-parameters-extends-type- }, }, - superTypeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'T', -- optional: false, -- -- range: [25, 26], -- loc: { -- start: { column: 25, line: 1 }, -- end: { column: 26, line: 1 }, -- }, -- }, -- -- range: [25, 26], -- loc: { -- start: { column: 25, line: 1 }, -- end: { column: 26, line: 1 }, -- }, -- }, -- ], -- -- range: [24, 27], -- loc: { -- start: { column: 24, line: 1 }, -- end: { column: 27, line: 1 }, -- }, -- }, - superTypeParameters: TSTypeParameterInstantiation { ++ superTypeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/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 981bc7f4732..021929e10a3 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,26 +78,6 @@ Program { end: { column: 34, line: 4 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSStringKeyword { - type: "TSStringKeyword", - - range: [147, 153], - loc: { - start: { column: 35, line: 4 }, - end: { column: 41, line: 4 }, - }, - }, - ], - - range: [146, 154], - loc: { - start: { column: 34, line: 4 }, - end: { column: 42, line: 4 }, - }, - }, range: [139, 154], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/5-AST-Alignment-AST.shot index 10846964c2c..0ab1de91b9e 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,38 +56,17 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-method typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSStringKeyword { -- type: 'TSStringKeyword', -- -- range: [147, 153], -- loc: { -- start: { column: 35, line: 4 }, -- end: { column: 41, line: 4 }, -- }, -- }, -- ], -- -- range: [146, 154], -- loc: { -- start: { column: 34, line: 4 }, -- end: { column: 42, line: 4 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', -- decorators: Array [], - name: 'Promise', -- optional: false, - - range: [139, 146], - loc: { - start: { column: 27, line: 4 }, - end: { column: 34, line: 4 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Promise', ++ ++ range: [139, 146], ++ loc: { ++ start: { column: 27, line: 4 }, ++ end: { column: 34, line: 4 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSStringKeyword { @@ -105,6 +84,18 @@ 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 828a42972e2..d495e8928a4 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,26 +78,6 @@ Program { end: { column: 26, line: 4 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSStringKeyword { - type: "TSStringKeyword", - - range: [139, 145], - loc: { - start: { column: 27, line: 4 }, - end: { column: 33, line: 4 }, - }, - }, - ], - - range: [138, 146], - loc: { - start: { column: 26, line: 4 }, - end: { column: 34, line: 4 }, - }, - }, range: [131, 146], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/5-AST-Alignment-AST.shot index d19a4504b28..b706fb052fb 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,38 +53,17 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-optional-method typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSStringKeyword { -- type: 'TSStringKeyword', -- -- range: [139, 145], -- loc: { -- start: { column: 27, line: 4 }, -- end: { column: 33, line: 4 }, -- }, -- }, -- ], -- -- range: [138, 146], -- loc: { -- start: { column: 26, line: 4 }, -- end: { column: 34, line: 4 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', -- decorators: Array [], - name: 'Promise', -- optional: false, - - range: [131, 138], - loc: { - start: { column: 19, line: 4 }, - end: { column: 26, line: 4 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Promise', ++ ++ range: [131, 138], ++ loc: { ++ start: { column: 19, line: 4 }, ++ end: { column: 26, line: 4 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSStringKeyword { @@ -104,7 +83,19 @@ 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-extends-generic-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/1-TSESTree-AST.shot index 00c4174cb44..b7438a0807d 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/1-TSESTree-AST.shot @@ -97,59 +97,6 @@ Program { end: { column: 40, line: 3 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - decorators: Array [], - name: "C", - optional: false, - - range: [108, 109], - loc: { - start: { column: 35, line: 3 }, - end: { column: 36, line: 3 }, - }, - }, - - range: [108, 109], - loc: { - start: { column: 35, line: 3 }, - end: { column: 36, line: 3 }, - }, - }, - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - decorators: Array [], - name: "D", - optional: false, - - range: [111, 112], - loc: { - start: { column: 38, line: 3 }, - end: { column: 39, line: 3 }, - }, - }, - - range: [111, 112], - loc: { - start: { column: 38, line: 3 }, - end: { column: 39, line: 3 }, - }, - }, - ], - - range: [107, 113], - loc: { - start: { column: 34, line: 3 }, - end: { column: 40, line: 3 }, - }, - }, typeParameters: TSTypeParameterDeclaration { type: "TSTypeParameterDeclaration", params: Array [ diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/5-AST-Alignment-AST.shot index 526a7b1c98d..a0e4a36150f 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/5-AST-Alignment-AST.shot @@ -46,62 +46,10 @@ exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic-multiple loc: { start: { column: 31, line: 3 }, end: { column: 34, line: 3 }, -- }, -- }, -- superTypeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'C', -- optional: false, -- -- range: [108, 109], -- loc: { -- start: { column: 35, line: 3 }, -- end: { column: 36, line: 3 }, -- }, -- }, -- -- range: [108, 109], -- loc: { -- start: { column: 35, line: 3 }, -- end: { column: 36, line: 3 }, -- }, -- }, -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'D', -- optional: false, -- -- range: [111, 112], -- loc: { -- start: { column: 38, line: 3 }, -- end: { column: 39, line: 3 }, -- }, -- }, -- -- range: [111, 112], -- loc: { -- start: { column: 38, line: 3 }, -- end: { column: 39, line: 3 }, -- }, -- }, -- ], -- -- range: [107, 113], -- loc: { -- start: { column: 34, line: 3 }, -- end: { column: 40, line: 3 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { +- superTypeArguments: TSTypeParameterInstantiation { ++ superTypeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/1-TSESTree-AST.shot index 65e2976d5a5..95595f15b73 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/1-TSESTree-AST.shot @@ -76,38 +76,6 @@ Program { end: { column: 27, line: 3 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - decorators: Array [], - name: "B", - optional: false, - - range: [98, 99], - loc: { - start: { column: 25, line: 3 }, - end: { column: 26, line: 3 }, - }, - }, - - range: [98, 99], - loc: { - start: { column: 25, line: 3 }, - end: { column: 26, line: 3 }, - }, - }, - ], - - range: [97, 100], - loc: { - start: { column: 24, line: 3 }, - end: { column: 27, line: 3 }, - }, - }, typeParameters: TSTypeParameterDeclaration { type: "TSTypeParameterDeclaration", params: Array [ diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/5-AST-Alignment-AST.shot index 2ca28ff707f..f5dd08fb20a 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/5-AST-Alignment-AST.shot @@ -49,38 +49,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic AST Alig }, }, - superTypeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'B', -- optional: false, -- -- range: [98, 99], -- loc: { -- start: { column: 25, line: 3 }, -- end: { column: 26, line: 3 }, -- }, -- }, -- -- range: [98, 99], -- loc: { -- start: { column: 25, line: 3 }, -- end: { column: 26, line: 3 }, -- }, -- }, -- ], -- -- range: [97, 100], -- loc: { -- start: { column: 24, line: 3 }, -- end: { column: 27, line: 3 }, -- }, -- }, - superTypeParameters: TSTypeParameterInstantiation { ++ superTypeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/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 edd1a3131b7..414eb6f700a 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,59 +99,6 @@ Program { end: { column: 30, line: 3 }, }, }, - 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 }, - }, - }, - 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 }, - }, - }, 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 5fe8f2ee625..9ac4c609f85 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,62 +50,10 @@ exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic-multi loc: { start: { column: 21, line: 3 }, end: { column: 24, line: 3 }, -- }, -- }, -- typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- 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 }, }, }, - typeParameters: TSTypeParameterInstantiation { +- typeArguments: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/1-TSESTree-AST.shot index 51bbd96c9ba..24c0e9200c9 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,38 +78,6 @@ Program { end: { column: 27, line: 3 }, }, }, - 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 }, - }, - }, 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 f3a4828f755..861c924cb00 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,38 +53,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic AST A }, }, - 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 }, -- }, -- }, -- ], -- -- range: [97, 100], -- loc: { -- start: { column: 24, line: 3 }, -- end: { column: 27, line: 3 }, -- }, -- }, - typeParameters: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/1-TSESTree-AST.shot index 710d6f21f58..f9cd526c1d0 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 @@ -127,38 +127,6 @@ Program { 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 }, - }, - }, 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 43be505fdc3..2a4cc7f5780 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 @@ -88,50 +88,17 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin-reference AST Alig constraint: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- 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 { ++ 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 { @@ -161,6 +128,18 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin-reference AST Alig 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 }, }, }, 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 08032c0c974..c9717b60a93 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 @@ -162,27 +162,6 @@ Program { end: { column: 32, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeLiteral { - type: "TSTypeLiteral", - members: Array [], - - range: [106, 108], - loc: { - start: { column: 33, line: 3 }, - end: { column: 35, line: 3 }, - }, - }, - ], - - range: [105, 109], - loc: { - start: { column: 32, line: 3 }, - end: { column: 36, line: 3 }, - }, - }, range: [94, 109], loc: { @@ -325,26 +304,6 @@ Program { end: { column: 22, line: 7 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSAnyKeyword { - type: "TSAnyKeyword", - - range: [175, 178], - loc: { - start: { column: 18, line: 7 }, - end: { column: 21, line: 7 }, - }, - }, - ], - - range: [174, 179], - loc: { - start: { column: 17, line: 7 }, - end: { column: 22, line: 7 }, - }, - }, range: [173, 182], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/5-AST-Alignment-AST.shot index 2a217b40d79..2a264c12e07 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 @@ -134,39 +134,17 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS constraint: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeLiteral { -- type: 'TSTypeLiteral', -- members: Array [], -- -- range: [106, 108], -- loc: { -- start: { column: 33, line: 3 }, -- end: { column: 35, line: 3 }, -- }, -- }, -- ], -- -- range: [105, 109], -- loc: { -- start: { column: 32, line: 3 }, -- end: { column: 36, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', -- decorators: Array [], - name: 'Constructor', -- optional: false, - - range: [94, 105], - loc: { - start: { column: 21, line: 3 }, - end: { column: 32, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Constructor', ++ ++ range: [94, 105], ++ loc: { ++ start: { column: 21, line: 3 }, ++ end: { column: 32, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeLiteral { @@ -187,7 +165,19 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS 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 }, +- }, +- }, +- range: [94, 109], loc: { start: { column: 21, line: 3 }, @@ -313,26 +303,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS }, optional: false, - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSAnyKeyword { -- type: 'TSAnyKeyword', -- -- range: [175, 178], -- loc: { -- start: { column: 18, line: 7 }, -- end: { column: 21, line: 7 }, -- }, -- }, -- ], -- -- range: [174, 179], -- loc: { -- start: { column: 17, line: 7 }, -- end: { column: 22, line: 7 }, -- }, -- }, - typeParameters: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSAnyKeyword { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/1-TSESTree-AST.shot index 42e5421559b..bc0c6d9ba9b 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,26 +189,6 @@ Program { end: { column: 16, line: 6 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSStringKeyword { - type: "TSStringKeyword", - - range: [145, 151], - loc: { - start: { column: 17, line: 6 }, - end: { column: 23, line: 6 }, - }, - }, - ], - - range: [144, 152], - loc: { - start: { column: 16, line: 6 }, - end: { column: 24, line: 6 }, - }, - }, range: [139, 152], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/5-AST-Alignment-AST.shot index 8b23e6f92c7..19856aa2f16 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,38 +162,17 @@ exports[`AST Fixtures legacy-fixtures basics function-with-types-assignation AST typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSStringKeyword { -- type: 'TSStringKeyword', -- -- range: [145, 151], -- loc: { -- start: { column: 17, line: 6 }, -- end: { column: 23, line: 6 }, -- }, -- }, -- ], -- -- range: [144, 152], -- loc: { -- start: { column: 16, line: 6 }, -- end: { column: 24, line: 6 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', -- decorators: Array [], - name: 'Array', -- optional: false, - - range: [139, 144], - loc: { - start: { column: 11, line: 6 }, - end: { column: 16, line: 6 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Array', ++ ++ range: [139, 144], ++ loc: { ++ start: { column: 11, line: 6 }, ++ end: { column: 16, line: 6 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSStringKeyword { @@ -211,6 +190,18 @@ 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 2a9874b67ba..1011e38c46e 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,38 +64,6 @@ Program { end: { column: 31, line: 3 }, }, }, - 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 }, - }, - }, 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 27684fa7dc2..6fd24009f58 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/5-AST-Alignment-AST.shot @@ -36,41 +36,10 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-extends-type-paramet loc: { start: { column: 25, line: 3 }, end: { column: 28, line: 3 }, -- }, -- }, -- typeArguments: 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 { +- typeArguments: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/1-TSESTree-AST.shot index 602764aad98..8b5cf3b1652 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,26 +61,6 @@ Program { end: { column: 34, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSStringKeyword { - type: "TSStringKeyword", - - range: [108, 114], - loc: { - start: { column: 35, line: 3 }, - end: { column: 41, line: 3 }, - }, - }, - ], - - range: [107, 115], - loc: { - start: { column: 34, line: 3 }, - end: { column: 42, line: 3 }, - }, - }, range: [102, 115], loc: { @@ -108,78 +88,6 @@ Program { end: { column: 28, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeArguments: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSStringKeyword { - type: "TSStringKeyword", - - range: [108, 114], - loc: { - start: { column: 35, line: 3 }, - end: { column: 41, line: 3 }, - }, - }, - ], - - range: [107, 115], - loc: { - start: { column: 34, line: 3 }, - end: { column: 42, line: 3 }, - }, - }, - typeName: Identifier { - type: "Identifier", - 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: { @@ -207,182 +115,6 @@ Program { end: { column: 22, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeArguments: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeArguments: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSStringKeyword { - type: "TSStringKeyword", - - range: [108, 114], - loc: { - start: { column: 35, line: 3 }, - end: { column: 41, line: 3 }, - }, - }, - ], - - range: [107, 115], - loc: { - start: { column: 34, line: 3 }, - end: { column: 42, line: 3 }, - }, - }, - typeName: Identifier { - type: "Identifier", - 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 }, - }, - }, 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 81ea3c385c7..fae5238938d 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,320 +24,49 @@ exports[`AST Fixtures legacy-fixtures basics nested-type-arguments AST Alignment typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSStringKeyword { -- type: 'TSStringKeyword', -- -- range: [108, 114], -- loc: { -- start: { column: 35, line: 3 }, -- end: { column: 41, line: 3 }, -- }, -- }, -- ], -- -- range: [107, 115], -- loc: { -- start: { column: 34, line: 3 }, -- end: { column: 42, line: 3 }, -- }, -- }, -- typeName: Identifier { -- type: 'Identifier', -- 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 { ++ 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 { ++ 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 { ++ 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 { @@ -357,6 +86,18 @@ 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: { @@ -372,7 +113,19 @@ 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 }, @@ -385,6 +138,18 @@ 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 e69bdd18a83..bdeeca5f0a5 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,26 +51,6 @@ Program { end: { column: 8, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSNeverKeyword { - type: "TSNeverKeyword", - - range: [82, 87], - loc: { - start: { column: 9, line: 3 }, - end: { column: 14, line: 3 }, - }, - }, - ], - - range: [81, 88], - loc: { - start: { column: 8, line: 3 }, - end: { column: 15, line: 3 }, - }, - }, range: [80, 88], loc: { @@ -171,26 +151,6 @@ Program { end: { column: 23, line: 4 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSNeverKeyword { - type: "TSNeverKeyword", - - range: [107, 112], - loc: { - start: { column: 17, line: 4 }, - end: { column: 22, line: 4 }, - }, - }, - ], - - range: [106, 113], - loc: { - start: { column: 16, line: 4 }, - end: { column: 23, line: 4 }, - }, - }, range: [90, 115], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/5-AST-Alignment-AST.shot index 455668676a7..17bbe4be48f 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,38 +24,17 @@ exports[`AST Fixtures legacy-fixtures basics never-type-param AST Alignment - AS typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSNeverKeyword { -- type: 'TSNeverKeyword', -- -- range: [82, 87], -- loc: { -- start: { column: 9, line: 3 }, -- end: { column: 14, line: 3 }, -- }, -- }, -- ], -- -- range: [81, 88], -- loc: { -- start: { column: 8, line: 3 }, -- end: { column: 15, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', -- decorators: Array [], - name: 'X', -- optional: false, - - range: [80, 81], - loc: { - start: { column: 7, line: 3 }, - end: { column: 8, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'X', ++ ++ range: [80, 81], ++ loc: { ++ start: { column: 7, line: 3 }, ++ end: { column: 8, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSNeverKeyword { @@ -73,6 +52,18 @@ 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 }, }, }, @@ -156,26 +147,7 @@ exports[`AST Fixtures legacy-fixtures basics never-type-param AST Alignment - AS }, optional: false, - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSNeverKeyword { -- type: 'TSNeverKeyword', -- -- range: [107, 112], -- loc: { -- start: { column: 17, line: 4 }, -- end: { column: 22, line: 4 }, -- }, -- }, -- ], -- -- range: [106, 113], -- loc: { -- start: { column: 16, line: 4 }, -- end: { column: 23, line: 4 }, -- }, -- }, - typeParameters: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSNeverKeyword { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/1-TSESTree-AST.shot index e7c7e89c2a8..d811b4c85fc 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,26 +197,6 @@ Program { end: { column: 31, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSStringKeyword { - type: "TSStringKeyword", - - range: [105, 111], - loc: { - start: { column: 32, line: 3 }, - end: { column: 38, line: 3 }, - }, - }, - ], - - range: [104, 112], - loc: { - start: { column: 31, line: 3 }, - end: { column: 39, line: 3 }, - }, - }, range: [91, 112], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/5-AST-Alignment-AST.shot index 9dc5b8fb7cc..2a61db765b8 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,38 +170,17 @@ exports[`AST Fixtures legacy-fixtures basics readonly-arrays AST Alignment - AST typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSStringKeyword { -- type: 'TSStringKeyword', -- -- range: [105, 111], -- loc: { -- start: { column: 32, line: 3 }, -- end: { column: 38, line: 3 }, -- }, -- }, -- ], -- -- range: [104, 112], -- loc: { -- start: { column: 31, line: 3 }, -- end: { column: 39, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', -- decorators: Array [], - name: 'ReadonlyArray', -- optional: false, - - range: [91, 104], - loc: { - start: { column: 18, line: 3 }, - end: { column: 31, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'ReadonlyArray', ++ ++ range: [91, 104], ++ loc: { ++ start: { column: 18, line: 3 }, ++ end: { column: 31, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSStringKeyword { @@ -219,6 +198,18 @@ 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 709a6c9171a..6f479d03760 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,35 +83,6 @@ Program { end: { column: 22, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSSymbolKeyword { - type: "TSSymbolKeyword", - - range: [96, 102], - loc: { - start: { column: 23, line: 3 }, - end: { column: 29, line: 3 }, - }, - }, - TSStringKeyword { - type: "TSStringKeyword", - - range: [104, 110], - loc: { - start: { column: 31, line: 3 }, - end: { column: 37, line: 3 }, - }, - }, - ], - - range: [95, 111], - loc: { - start: { column: 22, line: 3 }, - end: { column: 38, line: 3 }, - }, - }, range: [92, 111], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/5-AST-Alignment-AST.shot index 0f0a99e1336..b6d43bac4df 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,47 +47,17 @@ exports[`AST Fixtures legacy-fixtures basics symbol-type-param AST Alignment - A typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSSymbolKeyword { -- type: 'TSSymbolKeyword', -- -- range: [96, 102], -- loc: { -- start: { column: 23, line: 3 }, -- end: { column: 29, line: 3 }, -- }, -- }, -- TSStringKeyword { -- type: 'TSStringKeyword', -- -- range: [104, 110], -- loc: { -- start: { column: 31, line: 3 }, -- end: { column: 37, line: 3 }, -- }, -- }, -- ], -- -- range: [95, 111], -- loc: { -- start: { column: 22, line: 3 }, -- end: { column: 38, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', -- decorators: Array [], - name: 'Map', -- optional: false, - - range: [92, 95], - loc: { - start: { column: 19, line: 3 }, - end: { column: 22, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Map', ++ ++ range: [92, 95], ++ loc: { ++ start: { column: 19, line: 3 }, ++ end: { column: 22, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSSymbolKeyword { @@ -114,6 +84,18 @@ 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 d32f8c5b191..800a7247378 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,38 +68,6 @@ Program { 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 }, - }, - }, 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 67a40e53053..07245023a68 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,50 +29,17 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-with-constra TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- 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 { ++ 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 { @@ -102,6 +69,18 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-with-constra 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 }, }, }, 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 0a0e1000366..706a337712c 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,38 +68,6 @@ Program { 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 }, - }, - }, 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 95be17186b5..8152b33278e 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,50 +29,17 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration AST Alignmen TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- 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 { ++ 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 { @@ -102,6 +69,18 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration AST Alignmen 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 }, }, }, 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 02b5d9027e2..2444e150946 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,26 +78,6 @@ Program { end: { column: 28, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSAnyKeyword { - type: "TSAnyKeyword", - - range: [97, 100], - loc: { - start: { column: 24, line: 3 }, - end: { column: 27, line: 3 }, - }, - }, - ], - - range: [96, 101], - loc: { - start: { column: 23, line: 3 }, - end: { column: 28, line: 3 }, - }, - }, range: [84, 101], loc: { @@ -125,98 +105,6 @@ Program { end: { column: 10, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSImportType { - type: "TSImportType", - argument: TSLiteralType { - type: "TSLiteralType", - literal: Literal { - type: "Literal", - raw: "''", - value: "", - - range: [91, 93], - loc: { - start: { column: 18, line: 3 }, - end: { column: 20, line: 3 }, - }, - }, - - range: [91, 93], - loc: { - start: { column: 18, line: 3 }, - end: { column: 20, line: 3 }, - }, - }, - qualifier: Identifier { - type: "Identifier", - 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 }, - }, - }, 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 65ff013d7fe..f88b1bb5632 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,110 +26,17 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type-with-type-paramete typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSImportType { -- type: 'TSImportType', -- argument: TSLiteralType { -- type: 'TSLiteralType', -- literal: Literal { -- type: 'Literal', -- raw: '\\\\'\\\\'', -- value: '', -- -- range: [91, 93], -- loc: { -- start: { column: 18, line: 3 }, -- end: { column: 20, line: 3 }, -- }, -- }, -- -- range: [91, 93], -- loc: { -- start: { column: 18, line: 3 }, -- end: { column: 20, line: 3 }, -- }, -- }, -- qualifier: Identifier { -- type: 'Identifier', -- 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 { ++ 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 { @@ -140,18 +47,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 }, @@ -168,29 +75,10 @@ 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 }, }, }, - typeParameters: TSTypeParameterInstantiation { +- typeArguments: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSAnyKeyword { @@ -223,6 +111,18 @@ 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 5f06a8d0c45..0fdd1c6ad2b 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,7 +45,6 @@ Program { }, qualifier: null, typeArguments: null, - typeParameters: null, range: [89, 100], loc: { @@ -148,38 +147,6 @@ Program { end: { column: 25, line: 4 }, }, }, - 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 }, - }, - }, 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 37e97f347a8..2a797df1a14 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,7 +53,6 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type AST Alignment - AS }, - qualifier: null, - typeArguments: null, -- typeParameters: null, range: [89, 100], loc: { @@ -129,38 +128,7 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type AST Alignment - AS }, }, - typeArguments: 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 { ++ 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 fd4dafefecb..e6afbeb0ad9 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/1-TSESTree-AST.shot @@ -76,38 +76,6 @@ Program { end: { column: 67, line: 3 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - decorators: Array [], - name: "A", - optional: false, - - range: [128, 129], - loc: { - start: { column: 55, line: 3 }, - end: { column: 56, line: 3 }, - }, - }, - - range: [128, 129], - loc: { - start: { column: 55, line: 3 }, - end: { column: 56, line: 3 }, - }, - }, - ], - - range: [117, 140], - loc: { - start: { column: 44, line: 3 }, - end: { column: 67, line: 3 }, - }, - }, typeParameters: TSTypeParameterDeclaration { type: "TSTypeParameterDeclaration", params: Array [ @@ -221,38 +189,6 @@ Program { end: { column: 36, line: 6 }, }, }, - superTypeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - decorators: Array [], - name: "A", - optional: false, - - range: [219, 220], - loc: { - start: { column: 24, line: 6 }, - end: { column: 25, line: 6 }, - }, - }, - - range: [219, 220], - loc: { - start: { column: 24, line: 6 }, - end: { column: 25, line: 6 }, - }, - }, - ], - - range: [208, 231], - loc: { - start: { column: 13, line: 6 }, - end: { column: 36, line: 6 }, - }, - }, typeParameters: TSTypeParameterDeclaration { type: "TSTypeParameterDeclaration", params: Array [ @@ -374,38 +310,6 @@ Program { end: { column: 72, line: 7 }, }, }, - typeParameters: 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 }, - }, - }, range: [280, 307], loc: { @@ -527,38 +431,6 @@ Program { end: { column: 36, line: 9 }, }, }, - typeParameters: 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 }, - }, - }, 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 14af41c9cbd..9dae0c1c3cf 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/5-AST-Alignment-AST.shot @@ -49,38 +49,7 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A }, }, - superTypeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'A', -- optional: false, -- -- range: [128, 129], -- loc: { -- start: { column: 55, line: 3 }, -- end: { column: 56, line: 3 }, -- }, -- }, -- -- range: [128, 129], -- loc: { -- start: { column: 55, line: 3 }, -- end: { column: 56, line: 3 }, -- }, -- }, -- ], -- -- range: [117, 140], -- loc: { -- start: { column: 44, line: 3 }, -- end: { column: 67, line: 3 }, -- }, -- }, - superTypeParameters: TSTypeParameterInstantiation { ++ superTypeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -195,38 +164,7 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A }, }, - superTypeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'A', -- optional: false, -- -- range: [219, 220], -- loc: { -- start: { column: 24, line: 6 }, -- end: { column: 25, line: 6 }, -- }, -- }, -- -- range: [219, 220], -- loc: { -- start: { column: 24, line: 6 }, -- end: { column: 25, line: 6 }, -- }, -- }, -- ], -- -- range: [208, 231], -- loc: { -- start: { column: 13, line: 6 }, -- end: { column: 36, line: 6 }, -- }, -- }, - superTypeParameters: TSTypeParameterInstantiation { ++ superTypeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -289,8 +227,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 }, @@ -298,7 +235,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 }, @@ -351,38 +289,7 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A }, }, - 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 }, -- }, -- }, - typeParameters: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -445,8 +352,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 }, @@ -454,7 +360,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 }, @@ -504,41 +411,10 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A loc: { start: { column: 10, line: 9 }, end: { column: 13, line: 9 }, -- }, -- }, -- typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- 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 }, }, }, - typeParameters: TSTypeParameterInstantiation { +- typeArguments: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/1-TSESTree-AST.shot index 5f07e669fac..e3bbfecafb7 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,38 +54,6 @@ Program { end: { column: 38, line: 3 }, }, }, - 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 }, - }, - }, 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 eb982059d77..8a39aa11b1a 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,38 +27,7 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments AST Alignm }, optional: false, - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- 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 { ++ 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 c1c0efd7a10..73dc1feedc0 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,26 +89,6 @@ Program { end: { column: 29, line: 4 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSAnyKeyword { - type: "TSAnyKeyword", - - range: [127, 130], - loc: { - start: { column: 30, line: 4 }, - end: { column: 33, line: 4 }, - }, - }, - ], - - range: [126, 147], - loc: { - start: { column: 29, line: 4 }, - end: { column: 50, line: 4 }, - }, - }, range: [109, 147], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/5-AST-Alignment-AST.shot index 0204d7ccc9c..4af0d045e7b 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 b5c7a0ba6b3..974f3a07bb4 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,38 +54,6 @@ Program { end: { column: 6, line: 3 }, }, }, - 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 }, - }, - }, range: [73, 81], loc: { @@ -138,26 +106,6 @@ Program { end: { column: 11, line: 4 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSNumberKeyword { - type: "TSNumberKeyword", - - range: [87, 93], - loc: { - start: { column: 4, line: 4 }, - end: { column: 10, line: 4 }, - }, - }, - ], - - range: [86, 94], - loc: { - start: { column: 3, line: 4 }, - end: { column: 11, line: 4 }, - }, - }, range: [83, 96], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot index 90cd92550d8..b49a2455c85 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,38 +27,7 @@ exports[`AST Fixtures legacy-fixtures expressions call-expression-type-arguments }, optional: false, - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- 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 { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -123,26 +92,7 @@ exports[`AST Fixtures legacy-fixtures expressions call-expression-type-arguments }, optional: false, - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSNumberKeyword { -- type: 'TSNumberKeyword', -- -- range: [87, 93], -- loc: { -- start: { column: 4, line: 4 }, -- end: { column: 10, line: 4 }, -- }, -- }, -- ], -- -- range: [86, 94], -- loc: { -- start: { column: 3, line: 4 }, -- end: { column: 11, line: 4 }, -- }, -- }, - typeParameters: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSNumberKeyword { diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/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 e1967102708..cd0900a01b2 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,38 +69,6 @@ Program { end: { column: 18, line: 3 }, }, }, - typeParameters: 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 }, - }, - }, 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 ec536369f88..2786d19fdd3 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,41 +39,10 @@ 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 }, }, }, - typeParameters: TSTypeParameterInstantiation { +- typeArguments: 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 ed1558dd1df..9dc513da779 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,38 +79,6 @@ Program { end: { column: 11, line: 3 }, }, }, - 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 }, - }, - }, range: [73, 86], loc: { @@ -195,26 +163,6 @@ Program { end: { column: 16, line: 4 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSNumberKeyword { - type: "TSNumberKeyword", - - range: [97, 103], - loc: { - start: { column: 9, line: 4 }, - end: { column: 15, line: 4 }, - }, - }, - ], - - range: [96, 104], - loc: { - start: { column: 8, line: 4 }, - end: { column: 16, line: 4 }, - }, - }, range: [88, 106], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot index 79b391cda5d..e040ed835e2 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,38 +52,7 @@ exports[`AST Fixtures legacy-fixtures expressions optional-call-expression-type- }, optional: false, - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- 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 { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { @@ -180,26 +149,7 @@ exports[`AST Fixtures legacy-fixtures expressions optional-call-expression-type- }, optional: false, - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSNumberKeyword { -- type: 'TSNumberKeyword', -- -- range: [97, 103], -- loc: { -- start: { column: 9, line: 4 }, -- end: { column: 15, line: 4 }, -- }, -- }, -- ], -- -- range: [96, 104], -- loc: { -- start: { column: 8, line: 4 }, -- end: { column: 16, line: 4 }, -- }, -- }, - typeParameters: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSNumberKeyword { diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/1-TSESTree-AST.shot index e03d8af9d50..c67795c385a 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,38 +78,6 @@ Program { end: { column: 8, line: 3 }, }, }, - typeParameters: 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 }, - }, - }, 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 61e0f9e950f..dcf8eb70d96 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,41 +48,10 @@ 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 }, }, }, - typeParameters: TSTypeParameterInstantiation { +- typeArguments: 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 360bd72369f..4123ab196d3 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,26 +98,6 @@ Program { end: { column: 53, line: 4 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSAnyKeyword { - type: "TSAnyKeyword", - - range: [150, 153], - loc: { - start: { column: 54, line: 4 }, - end: { column: 57, line: 4 }, - }, - }, - ], - - range: [149, 154], - loc: { - start: { column: 53, line: 4 }, - end: { column: 58, line: 4 }, - }, - }, range: [140, 154], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/5-AST-Alignment-AST.shot index 39ad0f238b4..8732ff7462b 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,38 +71,17 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules declare-namespace-w typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSAnyKeyword { -- type: 'TSAnyKeyword', -- -- range: [150, 153], -- loc: { -- start: { column: 54, line: 4 }, -- end: { column: 57, line: 4 }, -- }, -- }, -- ], -- -- range: [149, 154], -- loc: { -- start: { column: 53, line: 4 }, -- end: { column: 58, line: 4 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', -- decorators: Array [], - name: 'Selection', -- optional: false, - - range: [140, 149], - loc: { - start: { column: 44, line: 4 }, - end: { column: 53, line: 4 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Selection', ++ ++ range: [140, 149], ++ loc: { ++ start: { column: 44, line: 4 }, ++ end: { column: 53, line: 4 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSAnyKeyword { @@ -122,7 +101,19 @@ 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 abbbdc6b6b1..2fd51f51750 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 @@ -218,49 +218,6 @@ Program { end: { column: 21, line: 7 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSInferType { - type: "TSInferType", - typeParameter: TSTypeParameter { - type: "TSTypeParameter", - in: false, - name: Identifier { - type: "Identifier", - 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 }, - }, - }, 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 abe31fcdd96..507e9977274 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 @@ -180,61 +180,17 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignme extendsType: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSInferType { -- type: 'TSInferType', -- typeParameter: TSTypeParameter { -- type: 'TSTypeParameter', -- in: false, -- name: Identifier { -- type: 'Identifier', -- 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 { ++ 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 { @@ -278,7 +234,19 @@ 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 dfc83c045ad..aca5b0ba182 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 @@ -149,38 +149,6 @@ Program { 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 }, - }, - }, range: [123, 138], loc: { @@ -422,38 +390,6 @@ Program { 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 }, - }, - }, range: [224, 239], loc: { @@ -686,38 +622,6 @@ Program { 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 }, - }, - }, range: [312, 327], loc: { @@ -950,38 +854,6 @@ Program { 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 }, - }, - }, 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 0d22bfebc50..b461a3b8456 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 @@ -111,50 +111,17 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS trueType: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- 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 { ++ 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 { @@ -186,7 +153,19 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS 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 }, +- }, +- }, +- range: [123, 138], loc: { start: { column: 50, line: 3 }, @@ -344,8 +323,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS - decorators: Array [], - name: 'U', - optional: false, -+ name: 'U', - +- - range: [202, 203], - loc: { - start: { column: 54, line: 4 }, @@ -353,7 +331,8 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS - }, - }, - out: false, -- ++ name: 'U', + range: [202, 218], loc: { start: { column: 54, line: 4 }, @@ -387,50 +366,17 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS trueType: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- 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 { ++ 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 { @@ -460,6 +406,18 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS loc: { start: { column: 16, line: 5 }, end: { column: 19, line: 5 }, +- }, +- }, +- typeName: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'MustBeNumber', +- optional: false, +- +- range: [224, 236], +- loc: { +- start: { column: 4, line: 5 }, +- end: { column: 16, line: 5 }, }, }, @@ -578,8 +536,7 @@ 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 }, @@ -587,7 +544,8 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS - }, - }, - out: false, -- ++ name: 'U', + range: [281, 297], loc: { start: { column: 30, line: 7 }, @@ -654,50 +612,17 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS trueType: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- 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 { ++ 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 { @@ -727,6 +652,18 @@ 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 }, }, }, @@ -836,8 +773,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS - decorators: Array [], - name: 'U', - optional: false, -+ name: 'U', - +- - range: [369, 370], - loc: { - start: { column: 30, line: 10 }, @@ -845,7 +781,8 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS - }, - }, - out: false, -- ++ name: 'U', + range: [369, 370], loc: { start: { column: 30, line: 10 }, @@ -921,50 +858,17 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS trueType: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- 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 { ++ 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 { @@ -996,7 +900,19 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS 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 }, +- }, +- }, +- range: [400, 415], loc: { start: { column: 4, line: 11 }, @@ -1104,8 +1020,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', @@ -1117,8 +1033,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 ae89d92d5e5..b0202b27fe7 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,46 +71,6 @@ Program { end: { column: 12, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSConstructorType { - type: "TSConstructorType", - abstract: false, - params: Array [], - returnType: TSTypeAnnotation { - type: "TSTypeAnnotation", - typeAnnotation: TSStringKeyword { - type: "TSStringKeyword", - - range: [96, 102], - loc: { - start: { column: 23, line: 3 }, - end: { column: 29, line: 3 }, - }, - }, - - range: [93, 102], - loc: { - start: { column: 20, line: 3 }, - end: { column: 29, line: 3 }, - }, - }, - - range: [86, 102], - loc: { - start: { column: 13, line: 3 }, - end: { column: 29, line: 3 }, - }, - }, - ], - - range: [85, 103], - loc: { - start: { column: 12, line: 3 }, - end: { column: 30, line: 3 }, - }, - }, range: [80, 103], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/5-AST-Alignment-AST.shot index 5432fcbc649..bccbac1b833 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,58 +24,17 @@ exports[`AST Fixtures legacy-fixtures types constructor-in-generic AST Alignment typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSConstructorType { -- type: 'TSConstructorType', -- abstract: false, -- params: Array [], -- returnType: TSTypeAnnotation { -- type: 'TSTypeAnnotation', -- typeAnnotation: TSStringKeyword { -- type: 'TSStringKeyword', -- -- range: [96, 102], -- loc: { -- start: { column: 23, line: 3 }, -- end: { column: 29, line: 3 }, -- }, -- }, -- -- range: [93, 102], -- loc: { -- start: { column: 20, line: 3 }, -- end: { column: 29, line: 3 }, -- }, -- }, -- -- range: [86, 102], -- loc: { -- start: { column: 13, line: 3 }, -- end: { column: 29, line: 3 }, -- }, -- }, -- ], -- -- range: [85, 103], -- loc: { -- start: { column: 12, line: 3 }, -- end: { column: 30, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', -- decorators: Array [], - name: 'Array', -- optional: false, - - range: [80, 85], - loc: { - start: { column: 7, line: 3 }, - end: { column: 12, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Array', ++ ++ range: [80, 85], ++ loc: { ++ start: { column: 7, line: 3 }, ++ end: { column: 12, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSConstructorType { @@ -117,7 +76,19 @@ 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 d89da0f79e3..db173f02378 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,45 +70,6 @@ Program { end: { column: 12, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSFunctionType { - type: "TSFunctionType", - params: Array [], - returnType: TSTypeAnnotation { - type: "TSTypeAnnotation", - typeAnnotation: TSVoidKeyword { - type: "TSVoidKeyword", - - range: [92, 96], - loc: { - start: { column: 19, line: 3 }, - end: { column: 23, line: 3 }, - }, - }, - - range: [89, 96], - loc: { - start: { column: 16, line: 3 }, - end: { column: 23, line: 3 }, - }, - }, - - range: [86, 96], - loc: { - start: { column: 13, line: 3 }, - end: { column: 23, line: 3 }, - }, - }, - ], - - range: [85, 97], - loc: { - start: { column: 12, line: 3 }, - end: { column: 24, line: 3 }, - }, - }, range: [80, 97], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/5-AST-Alignment-AST.shot index 97aa0da4e4c..bf666f461df 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,57 +24,17 @@ exports[`AST Fixtures legacy-fixtures types function-in-generic AST Alignment - typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSFunctionType { -- type: 'TSFunctionType', -- params: Array [], -- returnType: TSTypeAnnotation { -- type: 'TSTypeAnnotation', -- typeAnnotation: TSVoidKeyword { -- type: 'TSVoidKeyword', -- -- range: [92, 96], -- loc: { -- start: { column: 19, line: 3 }, -- end: { column: 23, line: 3 }, -- }, -- }, -- -- range: [89, 96], -- loc: { -- start: { column: 16, line: 3 }, -- end: { column: 23, line: 3 }, -- }, -- }, -- -- range: [86, 96], -- loc: { -- start: { column: 13, line: 3 }, -- end: { column: 23, line: 3 }, -- }, -- }, -- ], -- -- range: [85, 97], -- loc: { -- start: { column: 12, line: 3 }, -- end: { column: 24, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', -- decorators: Array [], - name: 'Array', -- optional: false, - - range: [80, 85], - loc: { - start: { column: 7, line: 3 }, - end: { column: 12, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Array', ++ ++ range: [80, 85], ++ loc: { ++ start: { column: 7, line: 3 }, ++ end: { column: 12, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSFunctionType { @@ -115,7 +75,19 @@ 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 40ce1b0d088..cdda95a9342 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,38 +112,6 @@ Program { 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 }, - }, - }, 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 c2470729a2c..048cc9a3ab5 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,50 +73,17 @@ exports[`AST Fixtures legacy-fixtures types intersection-type AST Alignment - AS typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- 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 { ++ 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 { @@ -148,6 +115,18 @@ exports[`AST Fixtures legacy-fixtures types intersection-type AST Alignment - AS 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 }, +- }, +- }, range: [106, 119], loc: { 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 41c0557f1e7..c0b38ac2979 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,26 +56,6 @@ Program { end: { column: 18, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSNumberKeyword { - type: "TSNumberKeyword", - - range: [92, 98], - loc: { - start: { column: 19, line: 3 }, - end: { column: 25, line: 3 }, - }, - }, - ], - - range: [91, 99], - loc: { - start: { column: 18, line: 3 }, - end: { column: 26, line: 3 }, - }, - }, range: [86, 99], loc: { @@ -103,78 +83,6 @@ Program { end: { column: 12, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeArguments: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSNumberKeyword { - type: "TSNumberKeyword", - - range: [92, 98], - loc: { - start: { column: 19, line: 3 }, - end: { column: 25, line: 3 }, - }, - }, - ], - - range: [91, 99], - loc: { - start: { column: 18, line: 3 }, - end: { column: 26, line: 3 }, - }, - }, - typeName: Identifier { - type: "Identifier", - 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 }, - }, - }, 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 103c3096381..1d1e3d2d477 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,127 +24,33 @@ exports[`AST Fixtures legacy-fixtures types reference-generic-nested AST Alignme typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSNumberKeyword { -- type: 'TSNumberKeyword', -- -- range: [92, 98], -- loc: { -- start: { column: 19, line: 3 }, -- end: { column: 25, line: 3 }, -- }, -- }, -- ], -- -- range: [91, 99], -- loc: { -- start: { column: 18, line: 3 }, -- end: { column: 26, line: 3 }, -- }, -- }, -- typeName: Identifier { -- type: 'Identifier', -- 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 { ++ 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 { ++ 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 { @@ -164,6 +70,18 @@ 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: { @@ -179,6 +97,18 @@ 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 e5f3f624be1..30bf352a1d3 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,26 +51,6 @@ Program { end: { column: 12, line: 3 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSNumberKeyword { - type: "TSNumberKeyword", - - range: [86, 92], - loc: { - start: { column: 13, line: 3 }, - end: { column: 19, line: 3 }, - }, - }, - ], - - range: [85, 93], - loc: { - start: { column: 12, line: 3 }, - end: { column: 20, line: 3 }, - }, - }, range: [80, 93], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/5-AST-Alignment-AST.shot index d154684870e..ef82ec276a6 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,38 +24,17 @@ exports[`AST Fixtures legacy-fixtures types reference-generic AST Alignment - AS typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSNumberKeyword { -- type: 'TSNumberKeyword', -- -- range: [86, 92], -- loc: { -- start: { column: 13, line: 3 }, -- end: { column: 19, line: 3 }, -- }, -- }, -- ], -- -- range: [85, 93], -- loc: { -- start: { column: 12, line: 3 }, -- end: { column: 20, line: 3 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', -- decorators: Array [], - name: 'Array', -- optional: false, - - range: [80, 85], - loc: { - start: { column: 7, line: 3 }, - end: { column: 12, line: 3 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Array', ++ ++ range: [80, 85], ++ loc: { ++ start: { column: 7, line: 3 }, ++ end: { column: 12, line: 3 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSNumberKeyword { @@ -75,7 +54,19 @@ 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 caf85e02c19..8bfe6bfe81c 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,38 +140,6 @@ Program { end: { column: 14, line: 4 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - decorators: Array [], - 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: { @@ -225,38 +193,6 @@ Program { end: { column: 32, 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 }, - }, - }, - - 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: { @@ -310,38 +246,6 @@ Program { end: { column: 51, line: 4 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - decorators: Array [], - 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: { @@ -395,38 +299,6 @@ Program { end: { column: 72, line: 4 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSTypeReference { - type: "TSTypeReference", - typeName: Identifier { - type: "Identifier", - decorators: Array [], - 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: { @@ -552,37 +424,6 @@ Program { end: { column: 33, line: 5 }, }, }, - typeParameters: TSTypeParameterInstantiation { - type: "TSTypeParameterInstantiation", - params: Array [ - TSLiteralType { - type: "TSLiteralType", - literal: Literal { - type: "Literal", - raw: "'heLLo'", - value: "heLLo", - - range: [232, 239], - loc: { - start: { column: 34, line: 5 }, - end: { column: 41, line: 5 }, - }, - }, - - range: [232, 239], - loc: { - start: { column: 34, line: 5 }, - end: { column: 41, line: 5 }, - }, - }, - ], - - range: [231, 240], - loc: { - start: { column: 33, line: 5 }, - end: { column: 42, line: 5 }, - }, - }, range: [211, 240], loc: { diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/5-AST-Alignment-AST.shot index 984e1b25eb7..19e49e5431b 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 @@ -57,20 +57,6 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen - 'cooked': ' - ', - 'raw': ' - ', - }, -- -- range: [136, 142], -- loc: { -- start: { column: 17, line: 4 }, -- end: { column: 23, line: 4 }, -- }, -- }, -- TemplateElement { -- type: 'TemplateElement', -- tail: false, -- value: Object { -- 'cooked': ' - ', -- 'raw': ' - ', -- }, + range: [124, 133], + loc: { + start: { column: 5, line: 4 }, @@ -86,6 +72,20 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + type: 'Identifier', + name: 'T', +- range: [136, 142], +- loc: { +- start: { column: 17, line: 4 }, +- end: { column: 23, line: 4 }, +- }, +- }, +- TemplateElement { +- type: 'TemplateElement', +- tail: false, +- value: Object { +- 'cooked': ' - ', +- 'raw': ' - ', +- }, +- - range: [154, 160], - loc: { - start: { column: 35, line: 4 }, @@ -99,13 +99,7 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen - 'cooked': ' - ', - 'raw': ' - ', - }, -+ range: [134, 135], -+ loc: { -+ start: { column: 15, line: 4 }, -+ end: { column: 16, line: 4 }, -+ }, -+ }, - +- - range: [173, 179], - loc: { - start: { column: 54, line: 4 }, @@ -140,7 +134,13 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen - decorators: Array [], - 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 }, @@ -160,66 +160,36 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + end: { column: 17, line: 4 }, }, - ], -- ++ }, + - range: [133, 136], -- loc: { ++ range: [124, 136], + loc: { - start: { column: 14, line: 4 }, -- end: { column: 17, line: 4 }, ++ start: { column: 5, line: 4 }, + end: { column: 17, line: 4 }, }, -- }, + }, - typeName: Identifier { - type: 'Identifier', - 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: [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: [124, 133], +- loc: { +- start: { column: 5, line: 4 }, +- end: { column: 14, line: 4 }, + range: [142, 151], + loc: { + start: { column: 23, line: 4 }, + end: { column: 32, line: 4 }, - }, -- ], -- -- range: [133, 136], -- loc: { -- start: { column: 14, line: 4 }, -- end: { column: 17, line: 4 }, ++ }, }, - }, + typeParameters: TSTypeParameterInstantiation { @@ -275,66 +245,36 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + end: { column: 35, line: 4 }, }, - ], -- ++ }, + - range: [151, 154], -- loc: { ++ range: [142, 154], + loc: { - start: { column: 32, line: 4 }, -- end: { column: 35, line: 4 }, ++ start: { column: 23, line: 4 }, + end: { column: 35, line: 4 }, }, -- }, + }, - typeName: Identifier { - type: 'Identifier', - 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: [152, 153], -- loc: { -- start: { column: 33, line: 4 }, -- end: { column: 34, line: 4 }, -- }, +- range: [142, 151], +- loc: { +- start: { column: 23, line: 4 }, +- end: { column: 32, line: 4 }, + range: [160, 170], + loc: { + start: { column: 41, line: 4 }, + end: { column: 51, line: 4 }, - }, -- ], -- -- range: [151, 154], -- loc: { -- start: { column: 32, line: 4 }, -- end: { column: 35, line: 4 }, ++ }, }, - }, + typeParameters: TSTypeParameterInstantiation { @@ -390,66 +330,36 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + end: { column: 54, line: 4 }, }, - ], -- ++ }, + - range: [170, 173], -- loc: { ++ range: [160, 173], + loc: { - start: { column: 51, line: 4 }, -- end: { column: 54, line: 4 }, ++ start: { column: 41, line: 4 }, + end: { column: 54, line: 4 }, }, -- }, + }, - typeName: Identifier { - type: 'Identifier', - 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: [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: [160, 170], +- loc: { +- start: { column: 41, line: 4 }, +- end: { column: 51, line: 4 }, + range: [179, 191], + loc: { + start: { column: 60, line: 4 }, + end: { column: 72, line: 4 }, - }, -- ], -- -- range: [170, 173], -- loc: { -- start: { column: 51, line: 4 }, -- end: { column: 54, line: 4 }, ++ }, }, - }, + typeParameters: TSTypeParameterInstantiation { @@ -529,26 +439,13 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + 'cooked': '', + 'raw': '', + }, - -- range: [179, 191], ++ + range: [121, 124], - loc: { -- start: { column: 60, line: 4 }, -- end: { column: 72, line: 4 }, ++ loc: { + start: { column: 2, line: 4 }, + end: { column: 5, line: 4 }, - }, - }, -- typeParameters: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSTypeReference { -- type: 'TSTypeReference', -- typeName: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'T', -- optional: false, ++ }, ++ }, + TemplateElement { + type: 'TemplateElement', + tail: false, @@ -557,12 +454,7 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + 'raw': ' - ', + }, -- range: [192, 193], -- loc: { -- start: { column: 73, line: 4 }, -- end: { column: 74, line: 4 }, -- }, -- }, +- range: [179, 191], + range: [136, 142], + loc: { + start: { column: 17, line: 4 }, @@ -576,16 +468,11 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + 'cooked': ' - ', + 'raw': ' - ', + }, - -- range: [192, 193], -- loc: { -- start: { column: 73, line: 4 }, -- end: { column: 74, line: 4 }, -- }, -- }, -- ], ++ + range: [154, 160], -+ loc: { + loc: { +- start: { column: 60, line: 4 }, +- end: { column: 72, line: 4 }, + start: { column: 35, line: 4 }, + end: { column: 41, line: 4 }, + }, @@ -597,12 +484,9 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + 'cooked': ' - ', + 'raw': ' - ', + }, - -- range: [191, 194], ++ + range: [173, 179], - loc: { -- start: { column: 72, line: 4 }, -- end: { column: 75, line: 4 }, ++ loc: { + start: { column: 54, line: 4 }, + end: { column: 60, line: 4 }, }, @@ -653,8 +537,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', @@ -666,8 +550,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', @@ -710,49 +594,17 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen typeAnnotation: TSTypeReference { type: 'TSTypeReference', - typeArguments: TSTypeParameterInstantiation { -- type: 'TSTypeParameterInstantiation', -- params: Array [ -- TSLiteralType { -- type: 'TSLiteralType', -- literal: Literal { -- type: 'Literal', -- raw: '\\\\'heLLo\\\\'', -- value: 'heLLo', -- -- range: [232, 239], -- loc: { -- start: { column: 34, line: 5 }, -- end: { column: 41, line: 5 }, -- }, -- }, -- -- range: [232, 239], -- loc: { -- start: { column: 34, line: 5 }, -- end: { column: 41, line: 5 }, -- }, -- }, -- ], -- -- range: [231, 240], -- loc: { -- start: { column: 33, line: 5 }, -- end: { column: 42, line: 5 }, -- }, -- }, - typeName: Identifier { - type: 'Identifier', -- decorators: Array [], - name: 'EnthusiasticGreeting', -- optional: false, - - range: [211, 231], - loc: { - start: { column: 13, line: 5 }, - end: { column: 33, line: 5 }, - }, - }, - typeParameters: TSTypeParameterInstantiation { ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'EnthusiasticGreeting', ++ ++ range: [211, 231], ++ loc: { ++ start: { column: 13, line: 5 }, ++ end: { column: 33, line: 5 }, ++ }, ++ }, ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSLiteralType { @@ -781,6 +633,18 @@ 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 4fe7efef243..f3e72818f74 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,38 +84,6 @@ Program { end: { column: 20, line: 3 }, }, }, - typeParameters: 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 }, - }, - }, 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 47c46716aab..4ff83eed65f 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,41 +54,10 @@ 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 }, }, }, - typeParameters: TSTypeParameterInstantiation { +- typeArguments: TSTypeParameterInstantiation { ++ typeParameters: TSTypeParameterInstantiation { type: 'TSTypeParameterInstantiation', params: Array [ TSTypeReference { diff --git a/packages/ast-spec/tests/util/parsers/typescript-estree.ts b/packages/ast-spec/tests/util/parsers/typescript-estree.ts index 3f26f539a7e..e73330a2f57 100644 --- a/packages/ast-spec/tests/util/parsers/typescript-estree.ts +++ b/packages/ast-spec/tests/util/parsers/typescript-estree.ts @@ -13,6 +13,7 @@ export function parseTSESTree( jsx: fixture.ext.endsWith('x'), loc: true, range: true, + suppressDeprecatedPropertyWarnings: true, tokens: true, }); const { tokens: _, comments: __, ...program } = result; diff --git a/packages/typescript-estree/src/ast-converter.ts b/packages/typescript-estree/src/ast-converter.ts index c1bca84629d..a4cb0a4b7dd 100644 --- a/packages/typescript-estree/src/ast-converter.ts +++ b/packages/typescript-estree/src/ast-converter.ts @@ -26,9 +26,11 @@ export function astConverter( * Recursively convert the TypeScript AST into an ESTree-compatible AST */ const instance = new Converter(ast, { - allowInvalidAST: parseSettings.allowInvalidAST || false, - errorOnUnknownASTType: parseSettings.errorOnUnknownASTType || false, + allowInvalidAST: parseSettings.allowInvalidAST, + errorOnUnknownASTType: parseSettings.errorOnUnknownASTType, shouldPreserveNodeMaps, + suppressDeprecatedPropertyWarnings: + parseSettings.suppressDeprecatedPropertyWarnings, }); const estree = instance.convertProgram(); diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 53ffcabdbc1..483de050a19 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -38,10 +38,11 @@ import { AST_NODE_TYPES } from './ts-estree'; const SyntaxKind = ts.SyntaxKind; -interface ConverterOptions { +export interface ConverterOptions { allowInvalidAST?: boolean; errorOnUnknownASTType?: boolean; shouldPreserveNodeMaps?: boolean; + suppressDeprecatedPropertyWarnings?: boolean; } /** @@ -78,7 +79,7 @@ export class Converter { * @param options additional options for the conversion * @returns the converted ESTreeNode */ - constructor(ast: ts.SourceFile, options: ConverterOptions = {}) { + constructor(ast: ts.SourceFile, options?: ConverterOptions) { this.ast = ast; this.options = { ...options }; } @@ -474,13 +475,18 @@ export class Converter { : null; } if ('typeArguments' in node) { - result.typeArguments = result.typeParameters = + result.typeArguments = node.typeArguments && 'pos' in node.typeArguments ? this.convertTypeArgumentsToTypeParameterInstantiation( node.typeArguments, node, ) : null; + this.#withDeprecatedAliasGetter( + result, + 'typeParameters', + 'typeArguments', + ); } if ('typeParameters' in node) { result.typeParameters = @@ -1542,21 +1548,25 @@ export class Converter { return result; } - case SyntaxKind.TaggedTemplateExpression: { - const typeArguments = node.typeArguments - ? this.convertTypeArgumentsToTypeParameterInstantiation( - node.typeArguments, - node, - ) - : undefined; - return this.createNode(node, { - type: AST_NODE_TYPES.TaggedTemplateExpression, - typeArguments, - typeParameters: typeArguments, - tag: this.convertChild(node.tag), - quasi: this.convertChild(node.template), - }); - } + case SyntaxKind.TaggedTemplateExpression: + return this.createNode( + node, + this.#withDeprecatedAliasGetter( + { + type: AST_NODE_TYPES.TaggedTemplateExpression, + typeArguments: + node.typeArguments && + this.convertTypeArgumentsToTypeParameterInstantiation( + node.typeArguments, + node, + ), + tag: this.convertChild(node.tag), + quasi: this.convertChild(node.template), + }, + 'typeParameters', + 'typeArguments', + ), + ); case SyntaxKind.TemplateHead: case SyntaxKind.TemplateMiddle: @@ -1742,37 +1752,42 @@ export class Converter { const result = this.createNode< TSESTree.ClassDeclaration | TSESTree.ClassExpression - >(node, { - type: classNodeType, - abstract: hasModifier(SyntaxKind.AbstractKeyword, node), - body: this.createNode(node, { - type: AST_NODE_TYPES.ClassBody, - body: node.members - .filter(isESTreeClassMember) - .map(el => this.convertChild(el)), - range: [node.members.pos - 1, node.end], - }), - declare: hasModifier(SyntaxKind.DeclareKeyword, node), - decorators: - getDecorators(node)?.map(el => this.convertChild(el)) ?? [], - id: this.convertChild(node.name), - implements: - implementsClause?.types.map(el => this.convertChild(el)) ?? [], - superClass: extendsClause?.types[0] - ? this.convertChild(extendsClause.types[0].expression) - : null, - superTypeArguments: undefined, - superTypeParameters: undefined, - typeParameters: - node.typeParameters && - this.convertTSTypeParametersToTypeParametersDeclaration( - node.typeParameters, - ), - }); + >( + node, + this.#withDeprecatedAliasGetter( + { + type: classNodeType, + abstract: hasModifier(SyntaxKind.AbstractKeyword, node), + body: this.createNode(node, { + type: AST_NODE_TYPES.ClassBody, + body: node.members + .filter(isESTreeClassMember) + .map(el => this.convertChild(el)), + range: [node.members.pos - 1, node.end], + }), + declare: hasModifier(SyntaxKind.DeclareKeyword, node), + decorators: + getDecorators(node)?.map(el => this.convertChild(el)) ?? [], + id: this.convertChild(node.name), + implements: + implementsClause?.types.map(el => this.convertChild(el)) ?? [], + superClass: extendsClause?.types[0] + ? this.convertChild(extendsClause.types[0].expression) + : null, + superTypeArguments: undefined, + typeParameters: + node.typeParameters && + this.convertTSTypeParametersToTypeParametersDeclaration( + node.typeParameters, + ), + }, + 'superTypeParameters', + 'superTypeArguments', + ), + ); if (extendsClause?.types[0]?.typeArguments) { - // eslint-disable-next-line deprecation/deprecation - result.superTypeArguments = result.superTypeParameters = + result.superTypeArguments = this.convertTypeArgumentsToTypeParameterInstantiation( extendsClause.types[0].typeArguments, extendsClause.types[0], @@ -2081,14 +2096,20 @@ export class Converter { node, ); - const result = this.createNode(node, { - type: AST_NODE_TYPES.CallExpression, - callee, - arguments: args, - optional: node.questionDotToken !== undefined, - typeArguments, - typeParameters: typeArguments, - }); + const result = this.createNode( + node, + this.#withDeprecatedAliasGetter( + { + type: AST_NODE_TYPES.CallExpression, + callee, + arguments: args, + optional: node.questionDotToken !== undefined, + typeArguments, + }, + 'typeParameters', + 'typeArguments', + ), + ); return this.convertChainExpression(result, node); } @@ -2102,15 +2123,21 @@ export class Converter { ); // NOTE - NewExpression cannot have an optional chain in it - return this.createNode(node, { - type: AST_NODE_TYPES.NewExpression, - arguments: node.arguments - ? node.arguments.map(el => this.convertChild(el)) - : [], - callee: this.convertChild(node.expression), - typeArguments, - typeParameters: typeArguments, - }); + return this.createNode( + node, + this.#withDeprecatedAliasGetter( + { + type: AST_NODE_TYPES.NewExpression, + arguments: node.arguments + ? node.arguments.map(el => this.convertChild(el)) + : [], + callee: this.convertChild(node.expression), + typeArguments, + }, + 'typeParameters', + 'typeArguments', + ), + ); } case SyntaxKind.ConditionalExpression: @@ -2259,52 +2286,61 @@ export class Converter { }); case SyntaxKind.JsxSelfClosingElement: { - const typeArguments = node.typeArguments - ? this.convertTypeArgumentsToTypeParameterInstantiation( - node.typeArguments, - node, - ) - : undefined; return this.createNode(node, { type: AST_NODE_TYPES.JSXElement, /** * Convert SyntaxKind.JsxSelfClosingElement to SyntaxKind.JsxOpeningElement, * TypeScript does not seem to have the idea of openingElement when tag is self-closing */ - openingElement: this.createNode(node, { - type: AST_NODE_TYPES.JSXOpeningElement, - typeArguments, - typeParameters: typeArguments, - selfClosing: true, - name: this.convertJSXTagName(node.tagName, node), - attributes: node.attributes.properties.map(el => - this.convertChild(el), + openingElement: this.createNode( + node, + this.#withDeprecatedAliasGetter( + { + type: AST_NODE_TYPES.JSXOpeningElement, + typeArguments: node.typeArguments + ? this.convertTypeArgumentsToTypeParameterInstantiation( + node.typeArguments, + node, + ) + : undefined, + selfClosing: true, + name: this.convertJSXTagName(node.tagName, node), + attributes: node.attributes.properties.map(el => + this.convertChild(el), + ), + range: getRange(node, this.ast), + }, + 'typeParameters', + 'typeArguments', ), - range: getRange(node, this.ast), - }), + ), closingElement: null, children: [], }); } case SyntaxKind.JsxOpeningElement: { - const typeArguments = - node.typeArguments && - this.convertTypeArgumentsToTypeParameterInstantiation( - node.typeArguments, - node, - ); - - return this.createNode(node, { - type: AST_NODE_TYPES.JSXOpeningElement, - typeArguments, - typeParameters: typeArguments, - selfClosing: false, - name: this.convertJSXTagName(node.tagName, node), - attributes: node.attributes.properties.map(el => - this.convertChild(el), + return this.createNode( + node, + this.#withDeprecatedAliasGetter( + { + type: AST_NODE_TYPES.JSXOpeningElement, + typeArguments: + node.typeArguments && + this.convertTypeArgumentsToTypeParameterInstantiation( + node.typeArguments, + node, + ), + selfClosing: false, + name: this.convertJSXTagName(node.tagName, node), + attributes: node.attributes.properties.map(el => + this.convertChild(el), + ), + }, + 'typeParameters', + 'typeArguments', ), - }); + ); } case SyntaxKind.JsxClosingElement: @@ -2381,20 +2417,24 @@ export class Converter { // TypeScript specific - case SyntaxKind.TypeReference: { - const typeArguments = node.typeArguments - ? this.convertTypeArgumentsToTypeParameterInstantiation( - node.typeArguments, - node, - ) - : undefined; - return this.createNode(node, { - type: AST_NODE_TYPES.TSTypeReference, - typeName: this.convertChild(node.typeName), - typeArguments, - typeParameters: typeArguments, - }); - } + case SyntaxKind.TypeReference: + return this.createNode( + node, + this.#withDeprecatedAliasGetter( + { + type: AST_NODE_TYPES.TSTypeReference, + typeName: this.convertChild(node.typeName), + typeArguments: + node.typeArguments && + this.convertTypeArgumentsToTypeParameterInstantiation( + node.typeArguments, + node, + ), + }, + 'typeParameters', + 'typeArguments', + ), + ); case SyntaxKind.TypeParameter: { return this.createNode(node, { @@ -2470,20 +2510,24 @@ export class Converter { }); } - case SyntaxKind.TypeQuery: { - const typeArguments = - node.typeArguments && - this.convertTypeArgumentsToTypeParameterInstantiation( - node.typeArguments, - node, - ); - return this.createNode(node, { - type: AST_NODE_TYPES.TSTypeQuery, - exprName: this.convertChild(node.exprName), - typeArguments, - typeParameters: typeArguments, - }); - } + case SyntaxKind.TypeQuery: + return this.createNode( + node, + this.#withDeprecatedAliasGetter( + { + type: AST_NODE_TYPES.TSTypeQuery, + exprName: this.convertChild(node.exprName), + typeArguments: + node.typeArguments && + this.convertTypeArgumentsToTypeParameterInstantiation( + node.typeArguments, + node, + ), + }, + 'typeParameters', + 'typeArguments', + ), + ); case SyntaxKind.MappedType: { return this.createNode(node, { @@ -2637,25 +2681,27 @@ export class Converter { ? AST_NODE_TYPES.TSClassImplements : AST_NODE_TYPES.TSInstantiationExpression; - const typeArguments = - node.typeArguments && - this.convertTypeArgumentsToTypeParameterInstantiation( - node.typeArguments, - node, - ); - - const result = this.createNode< + return this.createNode< | TSESTree.TSInterfaceHeritage | TSESTree.TSClassImplements | TSESTree.TSInstantiationExpression - >(node, { - type, - expression: this.convertChild(node.expression), - typeArguments, - typeParameters: typeArguments, - }); - - return result; + >( + node, + this.#withDeprecatedAliasGetter( + { + type, + expression: this.convertChild(node.expression), + typeArguments: + node.typeArguments && + this.convertTypeArgumentsToTypeParameterInstantiation( + node.typeArguments, + node, + ), + }, + 'typeParameters', + 'typeArguments', + ), + ); } case SyntaxKind.InterfaceDeclaration: { @@ -2729,20 +2775,26 @@ export class Converter { const token = findNextToken(node.getFirstToken()!, node, this.ast)!; range[0] = token.getStart(this.ast); } - const typeArguments = node.typeArguments - ? this.convertTypeArgumentsToTypeParameterInstantiation( - node.typeArguments, - node, - ) - : null; - const result = this.createNode(node, { - type: AST_NODE_TYPES.TSImportType, - argument: this.convertChild(node.argument), - qualifier: this.convertChild(node.qualifier), - typeArguments, - typeParameters: typeArguments, - range: range, - }); + const result = this.createNode( + node, + this.#withDeprecatedAliasGetter( + { + type: AST_NODE_TYPES.TSImportType, + argument: this.convertChild(node.argument), + qualifier: this.convertChild(node.qualifier), + typeArguments: node.typeArguments + ? this.convertTypeArgumentsToTypeParameterInstantiation( + node.typeArguments, + node, + ) + : null, + range: range, + }, + 'typeParameters', + 'typeArguments', + ), + ); + if (node.isTypeOf) { return this.createNode(node, { type: AST_NODE_TYPES.TSTypeQuery, @@ -3099,6 +3151,44 @@ export class Converter { } } + /** + * Creates a getter for a property under aliasKey that returns the value under + * valueKey. If suppressDeprecatedPropertyWarnings is not enabled, the + * getter also console warns about the deprecation. + * + * @see https://github.com/typescript-eslint/typescript-eslint/issues/6469 + */ + #withDeprecatedAliasGetter< + Properties extends { type: string }, + AliasKey extends string, + ValueKey extends keyof Properties & string, + >( + node: Properties, + aliasKey: AliasKey, + valueKey: ValueKey, + ): Properties & Record { + let errored = false; + + Object.defineProperty(node, aliasKey, { + get: this.options.suppressDeprecatedPropertyWarnings + ? (): Properties[typeof valueKey] => node[valueKey] + : (): Properties[typeof valueKey] => { + if (!this.options.suppressDeprecatedPropertyWarnings) { + if (!errored) { + // eslint-disable-next-line no-console + console.warn( + `The '${aliasKey}' property is deprecated on ${node.type} nodes. Use '${valueKey}' instead. See https://typescript-eslint.io/linting/troubleshooting#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.`, + ); + errored = true; + } + } + return node[valueKey]; + }, + }); + + return node as Properties & Record; + } + #throwError(node: ts.Node | number, message: string): asserts node is never { let start; let end; diff --git a/packages/typescript-estree/src/parseSettings/createParseSettings.ts b/packages/typescript-estree/src/parseSettings/createParseSettings.ts index de25a789fa9..28943a02c06 100644 --- a/packages/typescript-estree/src/parseSettings/createParseSettings.ts +++ b/packages/typescript-estree/src/parseSettings/createParseSettings.ts @@ -73,6 +73,9 @@ export function createParseSettings( projects: [], range: options.range === true, singleRun, + suppressDeprecatedPropertyWarnings: + options.suppressDeprecatedPropertyWarnings ?? + process.env.NODE_ENV !== 'test', tokens: options.tokens === true ? [] : null, tsconfigMatchCache: (TSCONFIG_MATCH_CACHE ??= new ExpiringCache( singleRun diff --git a/packages/typescript-estree/src/parseSettings/index.ts b/packages/typescript-estree/src/parseSettings/index.ts index 76f4853b084..9fc8986ad48 100644 --- a/packages/typescript-estree/src/parseSettings/index.ts +++ b/packages/typescript-estree/src/parseSettings/index.ts @@ -118,6 +118,11 @@ export interface MutableParseSettings { */ singleRun: boolean; + /** + * Whether deprecated AST properties should skip calling console.warn on accesses. + */ + suppressDeprecatedPropertyWarnings: boolean; + /** * If the `tokens` parse option is enabled, retrieved tokens. */ diff --git a/packages/typescript-estree/src/parser-options.ts b/packages/typescript-estree/src/parser-options.ts index 213084a4d89..da00e007d61 100644 --- a/packages/typescript-estree/src/parser-options.ts +++ b/packages/typescript-estree/src/parser-options.ts @@ -81,6 +81,11 @@ interface ParseOptions { * Set to true to create a top-level array containing all tokens from the file. */ tokens?: boolean; + + /** + * Whether deprecated AST properties should skip calling console.warn on accesses. + */ + suppressDeprecatedPropertyWarnings?: boolean; } interface ParseAndGenerateServicesOptions extends ParseOptions { diff --git a/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap index 2716f516148..902bd9561ed 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap @@ -150,66 +150,6 @@ exports[`convert deeplyCopy should convert array of nodes 1`] = ` "type": "Identifier", "typeAnnotation": undefined, }, - "typeParameters": undefined, - }, - ], - "range": [ - 7, - 10, - ], - "type": "TSTypeParameterInstantiation", - }, - "typeParameters": { - "loc": { - "end": { - "column": 10, - "line": 1, - }, - "start": { - "column": 7, - "line": 1, - }, - }, - "params": [ - { - "loc": { - "end": { - "column": 9, - "line": 1, - }, - "start": { - "column": 8, - "line": 1, - }, - }, - "range": [ - 8, - 9, - ], - "type": "TSTypeReference", - "typeArguments": undefined, - "typeName": { - "decorators": [], - "loc": { - "end": { - "column": 9, - "line": 1, - }, - "start": { - "column": 8, - "line": 1, - }, - }, - "name": "T", - "optional": false, - "range": [ - 8, - 9, - ], - "type": "Identifier", - "typeAnnotation": undefined, - }, - "typeParameters": undefined, }, ], "range": [ @@ -477,66 +417,6 @@ exports[`convert deeplyCopy should convert node with type arguments correctly 1` "type": "Identifier", "typeAnnotation": undefined, }, - "typeParameters": undefined, - }, - ], - "range": [ - 7, - 10, - ], - "type": "TSTypeParameterInstantiation", - }, - "typeParameters": { - "loc": { - "end": { - "column": 10, - "line": 1, - }, - "start": { - "column": 7, - "line": 1, - }, - }, - "params": [ - { - "loc": { - "end": { - "column": 9, - "line": 1, - }, - "start": { - "column": 8, - "line": 1, - }, - }, - "range": [ - 8, - 9, - ], - "type": "TSTypeReference", - "typeArguments": undefined, - "typeName": { - "decorators": [], - "loc": { - "end": { - "column": 9, - "line": 1, - }, - "start": { - "column": 8, - "line": 1, - }, - }, - "name": "T", - "optional": false, - "range": [ - 8, - 9, - ], - "type": "Identifier", - "typeAnnotation": undefined, - }, - "typeParameters": undefined, }, ], "range": [ diff --git a/packages/typescript-estree/tests/lib/__snapshots__/parse.test.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/parse.test.ts.snap index ba513da932c..8c2e7861435 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/parse.test.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/parse.test.ts.snap @@ -161,7 +161,6 @@ exports[`parseAndGenerateServices isolated parsing should parse .js file - with "selfClosing": true, "type": "JSXOpeningElement", "typeArguments": undefined, - "typeParameters": undefined, }, "range": [ 10, @@ -456,7 +455,6 @@ exports[`parseAndGenerateServices isolated parsing should parse .js file - with "selfClosing": true, "type": "JSXOpeningElement", "typeArguments": undefined, - "typeParameters": undefined, }, "range": [ 10, @@ -1339,7 +1337,6 @@ exports[`parseAndGenerateServices isolated parsing should parse .jsx file - with "selfClosing": true, "type": "JSXOpeningElement", "typeArguments": undefined, - "typeParameters": undefined, }, "range": [ 10, @@ -1634,7 +1631,6 @@ exports[`parseAndGenerateServices isolated parsing should parse .jsx file - with "selfClosing": true, "type": "JSXOpeningElement", "typeArguments": undefined, - "typeParameters": undefined, }, "range": [ 10, @@ -2665,7 +2661,6 @@ exports[`parseAndGenerateServices isolated parsing should parse .tsx file - with "selfClosing": true, "type": "JSXOpeningElement", "typeArguments": undefined, - "typeParameters": undefined, }, "range": [ 10, @@ -2960,7 +2955,6 @@ exports[`parseAndGenerateServices isolated parsing should parse .tsx file - with "selfClosing": true, "type": "JSXOpeningElement", "typeArguments": undefined, - "typeParameters": undefined, }, "range": [ 10, @@ -3623,7 +3617,6 @@ exports[`parseAndGenerateServices isolated parsing should parse .vue file - with "selfClosing": true, "type": "JSXOpeningElement", "typeArguments": undefined, - "typeParameters": undefined, }, "range": [ 10, diff --git a/packages/typescript-estree/tests/lib/convert.test.ts b/packages/typescript-estree/tests/lib/convert.test.ts index 1785c24b0e1..b7bacd4c881 100644 --- a/packages/typescript-estree/tests/lib/convert.test.ts +++ b/packages/typescript-estree/tests/lib/convert.test.ts @@ -1,7 +1,9 @@ +import type { TSESTree } from '@typescript-eslint/types'; import { AST_NODE_TYPES } from '@typescript-eslint/types'; import * as ts from 'typescript'; import type { TSNode } from '../../src'; +import type { ConverterOptions } from '../../src/convert'; import { Converter } from '../../src/convert'; describe('convert', () => { @@ -262,4 +264,64 @@ describe('convert', () => { expect(() => instance.convertProgram()).not.toThrow(); }); }); + + describe('suppressDeprecatedPropertyWarnings', () => { + const getEsCallExpression = ( + converterOptions: ConverterOptions, + ): TSESTree.CallExpression => { + const ast = convertCode(`callee();`); + const tsCallExpression = (ast.statements[0] as ts.ExpressionStatement) + .expression as ts.CallExpression; + const instance = new Converter(ast, { + shouldPreserveNodeMaps: true, + ...converterOptions, + }); + + instance.convertProgram(); + + const maps = instance.getASTMaps(); + + return maps.tsNodeToESTreeNodeMap.get(tsCallExpression); + }; + + it('logs on a deprecated property access when suppressDeprecatedPropertyWarnings is false', () => { + const warn = jest.spyOn(console, 'warn').mockImplementation(); + const esCallExpression = getEsCallExpression({ + suppressDeprecatedPropertyWarnings: false, + }); + + // eslint-disable-next-line deprecation/deprecation + esCallExpression.typeParameters; + + expect(warn).toHaveBeenCalledWith( + `The 'typeParameters' property is deprecated on CallExpression nodes. Use 'typeArguments' instead. See https://typescript-eslint.io/linting/troubleshooting#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings.`, + ); + }); + + it('does not log on a subsequent deprecated property access when suppressDeprecatedPropertyWarnings is false', () => { + const warn = jest.spyOn(console, 'warn').mockImplementation(); + const esCallExpression = getEsCallExpression({ + suppressDeprecatedPropertyWarnings: false, + }); + + /* eslint-disable deprecation/deprecation */ + esCallExpression.typeParameters; + esCallExpression.typeParameters; + /* eslint-enable deprecation/deprecation */ + + expect(warn).toHaveBeenCalledTimes(1); + }); + + it('does not log on a deprecated property access when suppressDeprecatedPropertyWarnings is true', () => { + const warn = jest.spyOn(console, 'warn').mockImplementation(); + const esCallExpression = getEsCallExpression({ + suppressDeprecatedPropertyWarnings: true, + }); + + // eslint-disable-next-line deprecation/deprecation + esCallExpression.typeParameters; + + expect(warn).not.toHaveBeenCalled(); + }); + }); }); diff --git a/packages/website/src/components/linter/config.ts b/packages/website/src/components/linter/config.ts index 7bfaeefe4cd..e528d202e64 100644 --- a/packages/website/src/components/linter/config.ts +++ b/packages/website/src/components/linter/config.ts @@ -21,6 +21,7 @@ export const parseSettings: ParseSettings = { projects: [], range: true, singleRun: false, + suppressDeprecatedPropertyWarnings: false, tokens: [], tsconfigMatchCache: new Map(), tsconfigRootDir: '/',