diff --git a/.prettierignore b/.prettierignore index 5e3434855df..548792bb901 100644 --- a/.prettierignore +++ b/.prettierignore @@ -14,6 +14,9 @@ packages/ast-spec/src/*/*/fixtures/_error_/*/fixture.ts # prettier doesn't yet support auto-accessors packages/ast-spec/src/element/AccessorProperty/fixtures +# prettier doesn't yet support `const` modifiers for type parameters +packages/ast-spec/src/special/TSTypeParameter/fixtures + # Ignore CHANGELOG.md files to avoid issues with automated release job CHANGELOG.md diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-param/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-param/snapshots/1-TSESTree-AST.shot index 13f2fe48ba0..782be4b44b2 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-param/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-param/snapshots/1-TSESTree-AST.shot @@ -32,6 +32,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-param/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-param/snapshots/5-AST-Alignment-AST.shot index 0ee9dbba035..8d97c664397 100644 --- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-param/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-param/snapshots/5-AST-Alignment-AST.shot @@ -36,6 +36,7 @@ exports[`AST Fixtures declaration ClassDeclaration type-param AST Alignment - AS params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', 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 aac248040d8..7e3c1cda98c 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 @@ -71,6 +71,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", 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 f6d5a3c73b3..60e9b202a98 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 @@ -75,6 +75,7 @@ exports[`AST Fixtures declaration ClassDeclaration type-parameters-extends-type- params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot index 24eae0d3290..bbdff121824 100644 --- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot @@ -35,6 +35,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -56,6 +57,7 @@ Program { }, TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -77,6 +79,7 @@ Program { }, TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot index 98ace90820f..b910a007d54 100644 --- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot @@ -39,6 +39,7 @@ exports[`AST Fixtures declaration FunctionDeclaration type-param-many AST Alignm params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -61,6 +62,7 @@ exports[`AST Fixtures declaration FunctionDeclaration type-param-many AST Alignm }, TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -83,6 +85,7 @@ exports[`AST Fixtures declaration FunctionDeclaration type-param-many AST Alignm }, TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot index b2caab0f05b..7ed214a6dac 100644 --- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot @@ -35,6 +35,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot index b997a40aca3..d54f1d9b395 100644 --- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot @@ -39,6 +39,7 @@ exports[`AST Fixtures declaration FunctionDeclaration type-param-one AST Alignme params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot index aefd6e905e2..7ebe6a511c9 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot @@ -26,6 +26,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -47,6 +48,7 @@ Program { }, TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -68,6 +70,7 @@ Program { }, TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot index 5c07aedab59..711d27f25cf 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot @@ -30,6 +30,7 @@ exports[`AST Fixtures declaration TSDeclareFunction type-param-many AST Alignmen params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -52,6 +53,7 @@ exports[`AST Fixtures declaration TSDeclareFunction type-param-many AST Alignmen }, TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -74,6 +76,7 @@ exports[`AST Fixtures declaration TSDeclareFunction type-param-many AST Alignmen }, TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot index 4767a93811c..f918dfb9f1e 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot @@ -26,6 +26,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot index 6763966b08f..a683f16a878 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot @@ -30,6 +30,7 @@ exports[`AST Fixtures declaration TSDeclareFunction type-param-one AST Alignment params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot index 6aea3322462..0dfd9b0dbed 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot @@ -31,6 +31,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -52,6 +53,7 @@ Program { }, TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -73,6 +75,7 @@ Program { }, TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot index 56e43bd6632..4b1dec3a269 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot @@ -35,6 +35,7 @@ exports[`AST Fixtures declaration TSInterfaceDeclaration type-param-many AST Ali params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -57,6 +58,7 @@ exports[`AST Fixtures declaration TSInterfaceDeclaration type-param-many AST Ali }, TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -79,6 +81,7 @@ exports[`AST Fixtures declaration TSInterfaceDeclaration type-param-many AST Ali }, TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot index 15f67448566..5a3ea46e5bb 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot @@ -31,6 +31,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot index d6859d52b51..8470b26ba84 100644 --- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot @@ -35,6 +35,7 @@ exports[`AST Fixtures declaration TSInterfaceDeclaration type-param-one AST Alig params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot index af8a41ed478..9e30e10752b 100644 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot @@ -41,6 +41,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot index a80b5aa0a11..939521199a6 100644 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot @@ -45,6 +45,7 @@ exports[`AST Fixtures declaration TSTypeAliasDeclaration type-param-many AST Ali params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot index 6bf2120e61b..9bf1ca3a104 100644 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot @@ -41,6 +41,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -62,6 +63,7 @@ Program { }, TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -83,6 +85,7 @@ Program { }, TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot index d754f2bf397..9ea3fc2ca74 100644 --- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot @@ -45,6 +45,7 @@ exports[`AST Fixtures declaration TSTypeAliasDeclaration type-param-one AST Alig params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -67,6 +68,7 @@ exports[`AST Fixtures declaration TSTypeAliasDeclaration type-param-one AST Alig }, TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -89,6 +91,7 @@ exports[`AST Fixtures declaration TSTypeAliasDeclaration type-param-one AST Alig }, TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/1-TSESTree-AST.shot index 5e87232cc31..6f555db8cd0 100644 --- a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/1-TSESTree-AST.shot @@ -35,6 +35,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/5-AST-Alignment-AST.shot index 546c2e3fa6b..681409dd0ec 100644 --- a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/5-AST-Alignment-AST.shot @@ -39,6 +39,7 @@ exports[`AST Fixtures legacy-fixtures babylon-convergence type-parameter-whitesp params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/1-TSESTree-AST.shot index 7612bfb5dbd..fb934bcd345 100644 --- a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/1-TSESTree-AST.shot @@ -35,6 +35,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, constraint: TSObjectKeyword { type: "TSObjectKeyword", diff --git a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/5-AST-Alignment-AST.shot index 6a4e1eb30bf..2567fb6d198 100644 --- a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/5-AST-Alignment-AST.shot @@ -39,6 +39,7 @@ exports[`AST Fixtures legacy-fixtures babylon-convergence type-parameters AST Al params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, constraint: TSObjectKeyword { type: 'TSObjectKeyword', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/1-TSESTree-AST.shot index 788e721214b..64b437f49e8 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/1-TSESTree-AST.shot @@ -115,6 +115,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/5-AST-Alignment-AST.shot index 0886302ddde..7f4ad90fdb0 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/5-AST-Alignment-AST.shot @@ -119,6 +119,7 @@ exports[`AST Fixtures legacy-fixtures basics arrow-function-with-type-parameters params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/1-TSESTree-AST.shot index 9346217d8e1..f9c5d072f70 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/1-TSESTree-AST.shot @@ -74,6 +74,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -163,6 +164,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/5-AST-Alignment-AST.shot index 6a4db1dffed..a60f0ce742c 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/5-AST-Alignment-AST.shot @@ -80,6 +80,7 @@ exports[`AST Fixtures legacy-fixtures basics call-signatures-with-generics AST A params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -172,6 +173,7 @@ exports[`AST Fixtures legacy-fixtures basics call-signatures-with-generics AST A params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', 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 3859f9dbe85..ae4834c3b19 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 @@ -90,6 +90,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, constraint: TSTypeReference { type: "TSTypeReference", typeName: Identifier { 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 543de450f92..baf4e31b33b 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 @@ -94,6 +94,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic-multiple params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, constraint: TSTypeReference { type: 'TSTypeReference', typeName: Identifier { 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 9251113d68d..e365a073333 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 @@ -71,6 +71,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", 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 ac8187f4368..ac7c601b7ec 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 @@ -75,6 +75,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic AST Alig params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/1-TSESTree-AST.shot index b39f7d0995d..c358470ad22 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/1-TSESTree-AST.shot @@ -47,6 +47,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, default: TSTypeReference { type: "TSTypeReference", typeName: Identifier { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/5-AST-Alignment-AST.shot index 72b1fa15c47..e9e2c7244b2 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/5-AST-Alignment-AST.shot @@ -51,6 +51,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-generic-method-default A params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, default: TSTypeReference { type: 'TSTypeReference', typeName: Identifier { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/1-TSESTree-AST.shot index 4cb9045a5ef..f6697f97e72 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/1-TSESTree-AST.shot @@ -47,6 +47,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/5-AST-Alignment-AST.shot index 6ec0c4dc779..d823b4570e5 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/5-AST-Alignment-AST.shot @@ -51,6 +51,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-generic-method AST Align params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/1-TSESTree-AST.shot index d86b4174035..8106d34ab7b 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/1-TSESTree-AST.shot @@ -112,6 +112,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/5-AST-Alignment-AST.shot index fa3122911f7..8b3757898e9 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/5-AST-Alignment-AST.shot @@ -116,6 +116,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-method AST Alignment - A params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', 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 ab072a5f07b..35a8324a5c4 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 @@ -74,6 +74,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, constraint: TSTypeReference { type: "TSTypeReference", typeName: Identifier { 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 24ee207bc65..f215d2b9478 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 @@ -78,6 +78,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin-reference AST Alig params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, constraint: TSTypeReference { type: 'TSTypeReference', typeName: Identifier { 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 5a3bdce9ce1..7571b2dce2e 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 @@ -114,6 +114,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, constraint: TSTypeReference { type: "TSTypeReference", typeName: Identifier { @@ -452,6 +453,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", 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 8801f524ccc..b113f663f51 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 @@ -118,6 +118,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, constraint: TSTypeReference { type: 'TSTypeReference', typeName: Identifier { @@ -461,6 +462,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/1-TSESTree-AST.shot index 7bf59de03da..edb09734f9b 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/1-TSESTree-AST.shot @@ -32,6 +32,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, default: TSTypeReference { type: "TSTypeReference", typeName: Identifier { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/5-AST-Alignment-AST.shot index efd120448d3..83d18346975 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/5-AST-Alignment-AST.shot @@ -36,6 +36,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter-default A params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, default: TSTypeReference { type: 'TSTypeReference', typeName: Identifier { diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/1-TSESTree-AST.shot index 11e13c3a1d9..3ceea1ac9bb 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/1-TSESTree-AST.shot @@ -32,6 +32,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/5-AST-Alignment-AST.shot index da8b2d5230b..d4ed8c5b153 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/5-AST-Alignment-AST.shot @@ -36,6 +36,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter-underscor params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/1-TSESTree-AST.shot index f4a699b1414..fe39caba13d 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/1-TSESTree-AST.shot @@ -32,6 +32,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/5-AST-Alignment-AST.shot index 28d9a945fca..8a7308c52fc 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/5-AST-Alignment-AST.shot @@ -36,6 +36,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter AST Align params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/1-TSESTree-AST.shot index 26e794c23c8..6b86bc109cb 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/1-TSESTree-AST.shot @@ -25,6 +25,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/5-AST-Alignment-AST.shot index 48fca727adc..64dc9ab9f6f 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/5-AST-Alignment-AST.shot @@ -29,6 +29,7 @@ exports[`AST Fixtures legacy-fixtures basics export-default-class-with-generic A params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot index 6f105eb8e62..f6f1e2e2b39 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot @@ -25,6 +25,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -46,6 +47,7 @@ Program { }, TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot index 4ffda7290af..77a16a4302d 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot @@ -29,6 +29,7 @@ exports[`AST Fixtures legacy-fixtures basics export-default-class-with-multiple- params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -51,6 +52,7 @@ exports[`AST Fixtures legacy-fixtures basics export-default-class-with-multiple- }, TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/1-TSESTree-AST.shot index 4a03c5671eb..ab3fe7fc1cb 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/1-TSESTree-AST.shot @@ -35,6 +35,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/5-AST-Alignment-AST.shot index c1c8ef30217..45815b0a978 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/5-AST-Alignment-AST.shot @@ -39,6 +39,7 @@ exports[`AST Fixtures legacy-fixtures basics export-named-class-with-generic AST params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot index 5f1bbd5e181..5bf16695b42 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot @@ -35,6 +35,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -56,6 +57,7 @@ Program { }, TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot index dd222440483..cafef05a22f 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot @@ -39,6 +39,7 @@ exports[`AST Fixtures legacy-fixtures basics export-named-class-with-multiple-ge params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -61,6 +62,7 @@ exports[`AST Fixtures legacy-fixtures basics export-named-class-with-multiple-ge }, TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/1-TSESTree-AST.shot index 7b536d258a7..41b3777d672 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/1-TSESTree-AST.shot @@ -90,6 +90,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/5-AST-Alignment-AST.shot index a35e030838b..5f19d6e96e4 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/5-AST-Alignment-AST.shot @@ -94,6 +94,7 @@ exports[`AST Fixtures legacy-fixtures basics function-anonymus-with-type-paramet params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/1-TSESTree-AST.shot index 6a8770bed94..aafa8b03f6d 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/1-TSESTree-AST.shot @@ -35,6 +35,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/5-AST-Alignment-AST.shot index 99cb440a924..c096db788aa 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/5-AST-Alignment-AST.shot @@ -39,6 +39,7 @@ exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters-that- params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/1-TSESTree-AST.shot index e2c552e2e1f..a6e6a40408c 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/1-TSESTree-AST.shot @@ -122,6 +122,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, constraint: TSTypeLiteral { type: "TSTypeLiteral", members: Array [], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/5-AST-Alignment-AST.shot index 16c2ff77580..76444e06f3c 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/5-AST-Alignment-AST.shot @@ -126,6 +126,7 @@ exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters-with- params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, constraint: TSTypeLiteral { type: 'TSTypeLiteral', members: Array [], diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/1-TSESTree-AST.shot index 4ce1b21c01c..deff03fd956 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/1-TSESTree-AST.shot @@ -122,6 +122,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/5-AST-Alignment-AST.shot index d191fba20dc..a47e9957bd9 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/5-AST-Alignment-AST.shot @@ -126,6 +126,7 @@ exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters AST A params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/1-TSESTree-AST.shot index 316e2a82e7f..2b15bd76598 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/1-TSESTree-AST.shot @@ -31,6 +31,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/5-AST-Alignment-AST.shot index ce9b773200c..d4403d29158 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/5-AST-Alignment-AST.shot @@ -35,6 +35,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-type-parameters AST Align params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/1-TSESTree-AST.shot index 2b42ff502a9..c8453b6255c 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/1-TSESTree-AST.shot @@ -473,6 +473,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -605,6 +606,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/5-AST-Alignment-AST.shot index abf4bc97439..11ec84abe7f 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/5-AST-Alignment-AST.shot @@ -485,6 +485,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -622,6 +623,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', 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 ec9ca83ec2c..c7d0b884a3b 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 @@ -82,6 +82,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", 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 54f1565f714..c4fc663d9e2 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 @@ -88,6 +88,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-extends-type-paramet params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/1-TSESTree-AST.shot index d3e96136ef6..3bd4cc3552f 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/1-TSESTree-AST.shot @@ -31,6 +31,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/5-AST-Alignment-AST.shot index bcc3599d418..79507cbad05 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/5-AST-Alignment-AST.shot @@ -35,6 +35,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-generic AST Alignmen params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/1-TSESTree-AST.shot index a85e5d164fc..5e8f5a67ced 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/1-TSESTree-AST.shot @@ -165,6 +165,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/5-AST-Alignment-AST.shot index f6f48a1fa51..e6b93ecb73b 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/5-AST-Alignment-AST.shot @@ -173,6 +173,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-method AST Alignment params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/1-TSESTree-AST.shot index 709dafa02b5..c4f36c1cdaa 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/1-TSESTree-AST.shot @@ -30,6 +30,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, constraint: TSStringKeyword { type: "TSStringKeyword", @@ -99,6 +100,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, constraint: TSStringKeyword { type: "TSStringKeyword", @@ -168,6 +170,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, constraint: TSStringKeyword { type: "TSStringKeyword", @@ -237,6 +240,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, constraint: TSStringKeyword { type: "TSStringKeyword", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/5-AST-Alignment-AST.shot index 69311fed221..89bf1373ea0 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/5-AST-Alignment-AST.shot @@ -34,6 +34,7 @@ exports[`AST Fixtures legacy-fixtures basics intrinsic-keyword AST Alignment - A params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, constraint: TSStringKeyword { type: 'TSStringKeyword', @@ -104,6 +105,7 @@ exports[`AST Fixtures legacy-fixtures basics intrinsic-keyword AST Alignment - A params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, constraint: TSStringKeyword { type: 'TSStringKeyword', @@ -111,8 +113,8 @@ exports[`AST Fixtures legacy-fixtures basics intrinsic-keyword AST Alignment - A loc: { start: { column: 25, line: 4 }, end: { column: 31, line: 4 }, -- }, -- }, + }, + }, - in: false, - name: Identifier { - type: 'Identifier', @@ -122,8 +124,8 @@ exports[`AST Fixtures legacy-fixtures basics intrinsic-keyword AST Alignment - A - loc: { - start: { column: 15, line: 4 }, - end: { column: 16, line: 4 }, - }, - }, +- }, +- }, - out: false, + name: 'S', @@ -174,6 +176,7 @@ exports[`AST Fixtures legacy-fixtures basics intrinsic-keyword AST Alignment - A params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, constraint: TSStringKeyword { type: 'TSStringKeyword', @@ -181,8 +184,8 @@ exports[`AST Fixtures legacy-fixtures basics intrinsic-keyword AST Alignment - A loc: { start: { column: 26, line: 5 }, end: { column: 32, line: 5 }, -- }, -- }, + }, + }, - in: false, - name: Identifier { - type: 'Identifier', @@ -192,8 +195,8 @@ exports[`AST Fixtures legacy-fixtures basics intrinsic-keyword AST Alignment - A - loc: { - start: { column: 16, line: 5 }, - end: { column: 17, line: 5 }, - }, - }, +- }, +- }, - out: false, + name: 'S', @@ -244,6 +247,7 @@ exports[`AST Fixtures legacy-fixtures basics intrinsic-keyword AST Alignment - A params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, constraint: TSStringKeyword { type: 'TSStringKeyword', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/1-TSESTree-AST.shot index e8f81ec7e88..c18166ff6dc 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/1-TSESTree-AST.shot @@ -99,6 +99,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -217,6 +218,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/5-AST-Alignment-AST.shot index 6dce128496d..134b63d05f4 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/5-AST-Alignment-AST.shot @@ -117,18 +117,19 @@ exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods AST Align loc: { start: { column: 18, line: 4 }, end: { column: 26, line: 4 }, - }, - }, +- }, +- }, - typeParameters: TSTypeParameterDeclaration { - type: 'TSTypeParameterDeclaration', - params: Array [ - TSTypeParameter { - type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', - name: 'T', - +- - range: [101, 102], - loc: { - start: { column: 14, line: 4 }, @@ -149,9 +150,9 @@ exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods AST Align - loc: { - start: { column: 13, line: 4 }, - end: { column: 16, line: 4 }, -- }, -- }, -- + }, + }, + - range: [100, 133], + range: [103, 133], loc: { @@ -258,18 +259,19 @@ exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods AST Align loc: { start: { column: 10, line: 7 }, end: { column: 18, line: 7 }, -- }, -- }, + }, + }, - typeParameters: TSTypeParameterDeclaration { - type: 'TSTypeParameterDeclaration', - params: Array [ - TSTypeParameter { - type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', - name: 'T', -- + - range: [141, 142], - loc: { - start: { column: 6, line: 7 }, @@ -290,9 +292,9 @@ exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods AST Align - loc: { - start: { column: 5, line: 7 }, - end: { column: 8, line: 7 }, - }, - }, - +- }, +- }, +- - range: [140, 173], + range: [143, 173], loc: { 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 795cf38b0f5..ce5a9d72e71 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 @@ -100,6 +100,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, constraint: TSTypeLiteral { type: "TSTypeLiteral", members: Array [], 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 dc8fc8c015a..e451c313454 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 @@ -104,6 +104,7 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-with-constra params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, constraint: TSTypeLiteral { type: 'TSTypeLiteral', members: Array [], 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 0a8917e84b8..53b3c3a9fcd 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 @@ -100,6 +100,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", 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 37f3b64b54e..95d18c2f62c 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 @@ -104,6 +104,7 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration AST Alignmen params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', 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 576e0c9b98a..999d0c3a74d 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 @@ -71,6 +71,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -172,6 +173,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, default: TSLiteralType { type: "TSLiteralType", literal: Literal { @@ -304,6 +306,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -416,6 +419,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, default: TSLiteralType { type: "TSLiteralType", literal: Literal { 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 d1bcce0c6fc..37c6b8de68f 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 @@ -75,6 +75,7 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -177,6 +178,7 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, default: TSLiteralType { type: 'TSLiteralType', literal: Literal { @@ -201,7 +203,8 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A - name: Identifier { - type: 'Identifier', - name: 'A', -- ++ name: 'A', + - range: [168, 169], - loc: { - start: { column: 12, line: 5 }, @@ -209,8 +212,7 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A - }, - }, - out: false, -+ name: 'A', - +- range: [168, 183], loc: { start: { column: 12, line: 5 }, @@ -312,6 +314,7 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -427,6 +430,7 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, default: TSLiteralType { type: 'TSLiteralType', literal: Literal { 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 15fde1c2edb..39047e8fcef 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 @@ -95,6 +95,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -160,6 +161,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, default: TSTypeReference { type: "TSTypeReference", typeName: Identifier { 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 ff26a6e29d7..724bdedf9c7 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 @@ -99,6 +99,7 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments AST Alignm params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -165,6 +166,7 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments AST Alignm params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, default: TSTypeReference { type: 'TSTypeReference', typeName: Identifier { @@ -182,8 +184,8 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments AST Alignm loc: { start: { column: 37, line: 5 }, end: { column: 40, line: 5 }, -- }, -- }, + }, + }, - in: false, - name: Identifier { - type: 'Identifier', @@ -193,8 +195,8 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments AST Alignm - loc: { - start: { column: 23, line: 5 }, - end: { column: 24, line: 5 }, - }, - }, +- }, +- }, - out: false, + name: 'A', diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/1-TSESTree-AST.shot index a1143b8b44c..c6167c1cfeb 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/1-TSESTree-AST.shot @@ -175,6 +175,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/5-AST-Alignment-AST.shot index 8d86878a9bc..71fe4bac95b 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/5-AST-Alignment-AST.shot @@ -183,6 +183,7 @@ exports[`AST Fixtures legacy-fixtures basics typed-method-signature AST Alignmen params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', 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 9bffe5d6717..4275a3f7ebb 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 @@ -43,6 +43,7 @@ Program { type: "TSInferType", typeParameter: TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -101,6 +102,7 @@ Program { type: "TSInferType", typeParameter: TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -167,6 +169,7 @@ Program { type: "TSInferType", typeParameter: TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -310,6 +313,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", 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 390ac4c254d..72a35e38426 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 @@ -47,6 +47,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignme - type: 'TSInferType', - typeParameter: TSTypeParameter { - type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -116,6 +117,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignme type: 'TSInferType', typeParameter: TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -183,6 +185,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignme type: 'TSInferType', typeParameter: TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -327,6 +330,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignme params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/1-TSESTree-AST.shot index a8b7cf3db2f..71c4e1069ee 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/1-TSESTree-AST.shot @@ -59,6 +59,7 @@ Program { type: "TSInferType", typeParameter: TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -118,6 +119,7 @@ Program { type: "TSInferType", typeParameter: TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -206,6 +208,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/5-AST-Alignment-AST.shot index a4c653aa539..3e71f1e73e3 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/5-AST-Alignment-AST.shot @@ -63,6 +63,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-simple AST Alignme type: 'TSInferType', typeParameter: TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -123,6 +124,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-simple AST Alignme type: 'TSInferType', typeParameter: TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -212,6 +214,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-simple AST Alignme params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', 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 f63f70371c8..ea44724e949 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 @@ -44,6 +44,7 @@ Program { type: "TSInferType", typeParameter: TSTypeParameter { type: "TSTypeParameter", + const: false, constraint: TSNumberKeyword { type: "TSNumberKeyword", @@ -157,6 +158,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -231,6 +233,7 @@ Program { type: "TSInferType", typeParameter: TSTypeParameter { type: "TSTypeParameter", + const: false, constraint: TSNumberKeyword { type: "TSNumberKeyword", @@ -270,6 +273,7 @@ Program { type: "TSInferType", typeParameter: TSTypeParameter { type: "TSTypeParameter", + const: false, constraint: TSNumberKeyword { type: "TSNumberKeyword", @@ -383,6 +387,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -457,6 +462,7 @@ Program { type: "TSInferType", typeParameter: TSTypeParameter { type: "TSTypeParameter", + const: false, constraint: TSNumberKeyword { type: "TSNumberKeyword", @@ -496,6 +502,7 @@ Program { type: "TSInferType", typeParameter: TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -600,6 +607,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -674,6 +682,7 @@ Program { type: "TSInferType", typeParameter: TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -704,6 +713,7 @@ Program { type: "TSInferType", typeParameter: TSTypeParameter { type: "TSTypeParameter", + const: false, constraint: TSNumberKeyword { type: "TSNumberKeyword", @@ -817,6 +827,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -891,6 +902,7 @@ Program { type: "TSInferType", typeParameter: TSTypeParameter { type: "TSTypeParameter", + const: false, constraint: TSStringKeyword { type: "TSStringKeyword", @@ -930,6 +942,7 @@ Program { type: "TSInferType", typeParameter: TSTypeParameter { type: "TSTypeParameter", + const: false, constraint: TSNumberKeyword { type: "TSNumberKeyword", @@ -1013,6 +1026,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", 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 5ae5b0f4966..66f821f85af 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 @@ -48,6 +48,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS type: 'TSInferType', typeParameter: TSTypeParameter { type: 'TSTypeParameter', +- const: false, constraint: TSNumberKeyword { type: 'TSNumberKeyword', @@ -162,6 +163,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -237,6 +239,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS type: 'TSInferType', typeParameter: TSTypeParameter { type: 'TSTypeParameter', +- const: false, constraint: TSNumberKeyword { type: 'TSNumberKeyword', @@ -277,6 +280,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS type: 'TSInferType', typeParameter: TSTypeParameter { type: 'TSTypeParameter', +- const: false, constraint: TSNumberKeyword { type: 'TSNumberKeyword', @@ -391,6 +395,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -466,6 +471,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS type: 'TSInferType', typeParameter: TSTypeParameter { type: 'TSTypeParameter', +- const: false, constraint: TSNumberKeyword { type: 'TSNumberKeyword', @@ -479,7 +485,8 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS - name: Identifier { - type: 'Identifier', - name: 'U', -- ++ name: 'U', + - range: [281, 282], - loc: { - start: { column: 30, line: 7 }, @@ -487,8 +494,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS - }, - }, - out: false, -+ name: 'U', - +- range: [281, 297], loc: { start: { column: 30, line: 7 }, @@ -506,6 +512,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS type: 'TSInferType', typeParameter: TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -611,6 +618,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -686,6 +694,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS type: 'TSInferType', typeParameter: TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -717,6 +726,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS type: 'TSInferType', typeParameter: TSTypeParameter { type: 'TSTypeParameter', +- const: false, constraint: TSNumberKeyword { type: 'TSNumberKeyword', @@ -831,6 +841,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -906,6 +917,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS type: 'TSInferType', typeParameter: TSTypeParameter { type: 'TSTypeParameter', +- const: false, constraint: TSStringKeyword { type: 'TSStringKeyword', @@ -946,6 +958,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS type: 'TSInferType', typeParameter: TSTypeParameter { type: 'TSTypeParameter', +- const: false, constraint: TSNumberKeyword { type: 'TSNumberKeyword', @@ -1030,6 +1043,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/1-TSESTree-AST.shot index 908466c31fd..d37879b44ab 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/1-TSESTree-AST.shot @@ -43,6 +43,7 @@ Program { type: "TSInferType", typeParameter: TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", @@ -126,6 +127,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/5-AST-Alignment-AST.shot index 285e659b66b..bc029519def 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/5-AST-Alignment-AST.shot @@ -47,6 +47,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer AST Alignment - AS - type: 'TSInferType', - typeParameter: TSTypeParameter { - type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', @@ -141,6 +142,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer AST Alignment - AS params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/1-TSESTree-AST.shot index 37e9d21a8b9..025c5b45329 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/1-TSESTree-AST.shot @@ -90,6 +90,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/5-AST-Alignment-AST.shot index fb218b26aa3..1726ad50b2f 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/5-AST-Alignment-AST.shot @@ -96,6 +96,7 @@ exports[`AST Fixtures legacy-fixtures types constructor-generic AST Alignment - params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/1-TSESTree-AST.shot index a2a6283fff8..58a3cfb4183 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/1-TSESTree-AST.shot @@ -89,6 +89,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/5-AST-Alignment-AST.shot index a8213dcf5ab..8fcec2c0905 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/5-AST-Alignment-AST.shot @@ -95,6 +95,7 @@ exports[`AST Fixtures legacy-fixtures types function-generic AST Alignment - AST params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', 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 de7addfe396..52a61f42484 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 @@ -140,6 +140,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", 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 4462a057b8b..1a756edb61f 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 @@ -144,6 +144,7 @@ exports[`AST Fixtures legacy-fixtures types intersection-type AST Alignment - AS params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/1-TSESTree-AST.shot index 6537caf714f..d0a14fbce55 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/1-TSESTree-AST.shot @@ -87,6 +87,7 @@ Program { }, typeParameter: TSTypeParameter { type: "TSTypeParameter", + const: false, constraint: TSTypeOperator { type: "TSTypeOperator", operator: "keyof", @@ -147,6 +148,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/5-AST-Alignment-AST.shot index a57f192e4a2..fb4d069532a 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/5-AST-Alignment-AST.shot @@ -91,6 +91,7 @@ exports[`AST Fixtures legacy-fixtures types mapped-named-type AST Alignment - AS }, typeParameter: TSTypeParameter { type: 'TSTypeParameter', +- const: false, constraint: TSTypeOperator { type: 'TSTypeOperator', operator: 'keyof', @@ -152,6 +153,7 @@ exports[`AST Fixtures legacy-fixtures types mapped-named-type AST Alignment - AS params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/1-TSESTree-AST.shot index 20121cf188a..26157d798fe 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/1-TSESTree-AST.shot @@ -30,6 +30,7 @@ Program { }, typeParameter: TSTypeParameter { type: "TSTypeParameter", + const: false, constraint: TSStringKeyword { type: "TSStringKeyword", diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/5-AST-Alignment-AST.shot index 65aeb0689ca..624a79fb35d 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/5-AST-Alignment-AST.shot @@ -34,6 +34,7 @@ exports[`AST Fixtures legacy-fixtures types mapped-readonly-minus AST Alignment }, typeParameter: TSTypeParameter { type: 'TSTypeParameter', +- const: false, constraint: TSStringKeyword { type: 'TSStringKeyword', diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/1-TSESTree-AST.shot index ad99fda9528..5ceb049ff33 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/1-TSESTree-AST.shot @@ -30,6 +30,7 @@ Program { }, typeParameter: TSTypeParameter { type: "TSTypeParameter", + const: false, constraint: TSStringKeyword { type: "TSStringKeyword", diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/5-AST-Alignment-AST.shot index 3148bb5b740..e6d132ed161 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/5-AST-Alignment-AST.shot @@ -34,6 +34,7 @@ exports[`AST Fixtures legacy-fixtures types mapped-readonly-plus AST Alignment - }, typeParameter: TSTypeParameter { type: 'TSTypeParameter', +- const: false, constraint: TSStringKeyword { type: 'TSStringKeyword', diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/1-TSESTree-AST.shot index d69be386629..13dbfd5fd9d 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/1-TSESTree-AST.shot @@ -30,6 +30,7 @@ Program { }, typeParameter: TSTypeParameter { type: "TSTypeParameter", + const: false, constraint: TSStringKeyword { type: "TSStringKeyword", diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/5-AST-Alignment-AST.shot index 75e06a9b433..cd82008e2c3 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/5-AST-Alignment-AST.shot @@ -34,6 +34,7 @@ exports[`AST Fixtures legacy-fixtures types mapped-readonly AST Alignment - AST }, typeParameter: TSTypeParameter { type: 'TSTypeParameter', +- const: false, constraint: TSStringKeyword { type: 'TSStringKeyword', diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/1-TSESTree-AST.shot index aedabb491bc..9e69aba7257 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/1-TSESTree-AST.shot @@ -19,6 +19,7 @@ Program { nameType: null, typeParameter: TSTypeParameter { type: "TSTypeParameter", + const: false, constraint: TSStringKeyword { type: "TSStringKeyword", diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/5-AST-Alignment-AST.shot index 03f4bb194f8..11ad724238e 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/5-AST-Alignment-AST.shot @@ -23,6 +23,7 @@ exports[`AST Fixtures legacy-fixtures types mapped-untypped AST Alignment - AST nameType: null, typeParameter: TSTypeParameter { type: 'TSTypeParameter', +- const: false, constraint: TSStringKeyword { type: 'TSStringKeyword', diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/1-TSESTree-AST.shot index 95ee43a3255..98713d77e9b 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/1-TSESTree-AST.shot @@ -28,6 +28,7 @@ Program { }, typeParameter: TSTypeParameter { type: "TSTypeParameter", + const: false, constraint: TSStringKeyword { type: "TSStringKeyword", diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/5-AST-Alignment-AST.shot index c46578e24d0..75db4f14353 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/5-AST-Alignment-AST.shot @@ -32,6 +32,7 @@ exports[`AST Fixtures legacy-fixtures types mapped AST Alignment - AST 1`] = ` }, typeParameter: TSTypeParameter { type: 'TSTypeParameter', +- const: false, constraint: TSStringKeyword { type: 'TSStringKeyword', diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/1-TSESTree-AST.shot index f224655bb63..81d37b235ba 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/1-TSESTree-AST.shot @@ -98,6 +98,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: true, name: Identifier { type: "Identifier", @@ -119,6 +120,7 @@ Program { }, TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/5-AST-Alignment-AST.shot index 0acb047d675..d5831586688 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/5-AST-Alignment-AST.shot @@ -104,6 +104,7 @@ exports[`AST Fixtures legacy-fixtures types optional-variance-in-and-out AST Ali params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, in: true, - name: Identifier { - type: 'Identifier', @@ -126,6 +127,7 @@ exports[`AST Fixtures legacy-fixtures types optional-variance-in-and-out AST Ali }, TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/1-TSESTree-AST.shot index 86e8cc26e85..070d7a33c7b 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/1-TSESTree-AST.shot @@ -98,6 +98,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: true, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/5-AST-Alignment-AST.shot index c8f77719ef7..5b560fa04c4 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/5-AST-Alignment-AST.shot @@ -104,6 +104,7 @@ exports[`AST Fixtures legacy-fixtures types optional-variance-in-out AST Alignme params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, in: true, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/1-TSESTree-AST.shot index 101936bcbab..3842372420d 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/1-TSESTree-AST.shot @@ -88,6 +88,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: true, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/5-AST-Alignment-AST.shot index 20b933b3fd6..1c8d89c3680 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/5-AST-Alignment-AST.shot @@ -94,6 +94,7 @@ exports[`AST Fixtures legacy-fixtures types optional-variance-in AST Alignment - params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, in: true, - name: Identifier { - type: 'Identifier', diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/1-TSESTree-AST.shot index 192a30ecd8b..a196f567eb8 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/1-TSESTree-AST.shot @@ -59,6 +59,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, in: false, name: Identifier { type: "Identifier", diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/5-AST-Alignment-AST.shot index ae55b74f2dc..9afebcfe430 100644 --- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/5-AST-Alignment-AST.shot @@ -65,6 +65,7 @@ exports[`AST Fixtures legacy-fixtures types optional-variance-out AST Alignment params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, - in: false, - name: Identifier { - type: 'Identifier', 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 1b9878d79b7..f299934132b 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 @@ -300,6 +300,7 @@ Program { params: Array [ TSTypeParameter { type: "TSTypeParameter", + const: false, constraint: TSStringKeyword { type: "TSStringKeyword", 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 d6b807f6ded..06e7cb02c0e 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 @@ -256,44 +256,35 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + start: { column: 23, line: 4 }, end: { column: 35, line: 4 }, }, - }, -+ TSTypeReference { -+ type: 'TSTypeReference', -+ typeName: Identifier { -+ type: 'Identifier', -+ name: 'Capitalize', - +- }, +- - range: [142, 154], - loc: { - start: { column: 23, line: 4 }, - end: { column: 35, line: 4 }, -- }, + }, - }, - TSTypeReference { - type: 'TSTypeReference', - typeName: Identifier { - type: 'Identifier', - name: 'Capitalize', -+ range: [160, 170], -+ loc: { -+ start: { column: 41, line: 4 }, -+ end: { column: 51, line: 4 }, -+ }, -+ }, -+ typeParameters: TSTypeParameterInstantiation { -+ type: 'TSTypeParameterInstantiation', -+ params: Array [ -+ TSTypeReference { -+ type: 'TSTypeReference', -+ typeName: Identifier { -+ type: 'Identifier', -+ name: 'T', ++ TSTypeReference { ++ type: 'TSTypeReference', ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Capitalize', - range: [160, 170], - loc: { - start: { column: 41, line: 4 }, - end: { column: 51, line: 4 }, -- }, ++ range: [160, 170], ++ loc: { ++ start: { column: 41, line: 4 }, ++ end: { column: 51, line: 4 }, ++ }, + }, - }, - typeParameters: TSTypeParameterInstantiation { - type: 'TSTypeParameterInstantiation', @@ -303,13 +294,22 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen - typeName: Identifier { - type: 'Identifier', - name: 'T', ++ typeParameters: TSTypeParameterInstantiation { ++ type: 'TSTypeParameterInstantiation', ++ params: Array [ ++ TSTypeReference { ++ type: 'TSTypeReference', ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'T', + + range: [171, 172], + loc: { + start: { column: 52, line: 4 }, + end: { column: 53, line: 4 }, + }, + }, - ++ range: [171, 172], loc: { start: { column: 52, line: 4 }, @@ -338,44 +338,35 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen + start: { column: 41, line: 4 }, end: { column: 54, line: 4 }, }, - }, -+ TSTypeReference { -+ type: 'TSTypeReference', -+ typeName: Identifier { -+ type: 'Identifier', -+ name: 'Uncapitalize', - +- }, +- - range: [160, 173], - loc: { - start: { column: 41, line: 4 }, - end: { column: 54, line: 4 }, -- }, + }, - }, - TSTypeReference { - type: 'TSTypeReference', - typeName: Identifier { - type: 'Identifier', - name: 'Uncapitalize', -+ range: [179, 191], -+ loc: { -+ start: { column: 60, line: 4 }, -+ end: { column: 72, line: 4 }, -+ }, -+ }, -+ typeParameters: TSTypeParameterInstantiation { -+ type: 'TSTypeParameterInstantiation', -+ params: Array [ -+ TSTypeReference { -+ type: 'TSTypeReference', -+ typeName: Identifier { -+ type: 'Identifier', -+ name: 'T', ++ TSTypeReference { ++ type: 'TSTypeReference', ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'Uncapitalize', - range: [179, 191], - loc: { - start: { column: 60, line: 4 }, - end: { column: 72, line: 4 }, -- }, ++ range: [179, 191], ++ loc: { ++ start: { column: 60, line: 4 }, ++ end: { column: 72, line: 4 }, ++ }, + }, - }, - typeParameters: TSTypeParameterInstantiation { - type: 'TSTypeParameterInstantiation', @@ -385,6 +376,15 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen - typeName: Identifier { - type: 'Identifier', - name: 'T', ++ typeParameters: TSTypeParameterInstantiation { ++ type: 'TSTypeParameterInstantiation', ++ params: Array [ ++ TSTypeReference { ++ type: 'TSTypeReference', ++ typeName: Identifier { ++ type: 'Identifier', ++ name: 'T', ++ + range: [192, 193], + loc: { + start: { column: 73, line: 4 }, @@ -518,6 +518,7 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen params: Array [ TSTypeParameter { type: 'TSTypeParameter', +- const: false, constraint: TSStringKeyword { type: 'TSStringKeyword', diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/fixture.ts new file mode 100644 index 00000000000..6449f9a9a32 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/fixture.ts @@ -0,0 +1 @@ +() => {}; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..4196b1ffe0e --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,101 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter arrow-const-modifier-extends TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [25, 27], + loc: { + start: { column: 25, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + constraint: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + out: false, + + range: [1, 18], + loc: { + start: { column: 1, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [0, 19], + loc: { + start: { column: 0, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..1121e5b9ac3 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter arrow-const-modifier-extends TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "<", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [1, 6], + loc: { + start: { column: 1, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [9, 16], + loc: { + start: { column: 9, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [22, 24], + loc: { + start: { column: 22, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..47e9fb0466a --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/3-Babel-AST.shot @@ -0,0 +1,90 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter arrow-const-modifier-extends Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [25, 27], + loc: { + start: { column: 25, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + constraint: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + name: "T", + + range: [1, 18], + loc: { + start: { column: 1, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [0, 19], + loc: { + start: { column: 0, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..e353eb64634 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter arrow-const-modifier-extends Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "<", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [1, 6], + loc: { + start: { column: 1, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [9, 16], + loc: { + start: { column: 9, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [22, 24], + loc: { + start: { column: 22, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..a1609757d3c --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter arrow-const-modifier-extends AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExpressionStatement { + type: 'ExpressionStatement', + expression: ArrowFunctionExpression { + type: 'ArrowFunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [25, 27], + loc: { + start: { column: 25, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + const: true, + constraint: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'U', + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [7, 8], +- loc: { +- start: { column: 7, line: 1 }, +- end: { column: 8, line: 1 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [1, 18], + loc: { + start: { column: 1, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [0, 19], + loc: { + start: { column: 0, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..098a78ba535 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter arrow-const-modifier-extends AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/fixture.ts new file mode 100644 index 00000000000..e887ecf8788 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/fixture.ts @@ -0,0 +1 @@ +() => {}; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..766e190e49f --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,82 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter arrow-const-modifier TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [15, 17], + loc: { + start: { column: 15, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + out: false, + + range: [1, 8], + loc: { + start: { column: 1, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + ], + + range: [0, 9], + loc: { + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + + range: [0, 17], + loc: { + start: { column: 0, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [0, 18], + loc: { + start: { column: 0, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 19], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..6fd763d2a2d --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter arrow-const-modifier TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "<", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [1, 6], + loc: { + start: { column: 1, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [12, 14], + loc: { + start: { column: 12, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..e5ea70f6a9e --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/3-Babel-AST.shot @@ -0,0 +1,71 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter arrow-const-modifier Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [15, 17], + loc: { + start: { column: 15, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + name: "T", + + range: [1, 8], + loc: { + start: { column: 1, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + ], + + range: [0, 9], + loc: { + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + + range: [0, 17], + loc: { + start: { column: 0, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [0, 18], + loc: { + start: { column: 0, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 19], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..91a25dd7138 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter arrow-const-modifier Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "<", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [1, 6], + loc: { + start: { column: 1, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [12, 14], + loc: { + start: { column: 12, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..0fd5e92e286 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,87 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter arrow-const-modifier AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExpressionStatement { + type: 'ExpressionStatement', + expression: ArrowFunctionExpression { + type: 'ArrowFunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [15, 17], + loc: { + start: { column: 15, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + const: true, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [7, 8], +- loc: { +- start: { column: 7, line: 1 }, +- end: { column: 8, line: 1 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [1, 8], + loc: { + start: { column: 1, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + ], + + range: [0, 9], + loc: { + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + + range: [0, 17], + loc: { + start: { column: 0, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [0, 18], + loc: { + start: { column: 0, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 19], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..30ea230053e --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter arrow-const-modifier AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/fixture.ts new file mode 100644 index 00000000000..a6771c2cdb4 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/fixture.ts @@ -0,0 +1 @@ +class E {} diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..24e7c42ba0f --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,79 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-const-in-modifier TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [20, 22], + loc: { + start: { column: 20, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "E", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: true, + name: Identifier { + type: "Identifier", + name: "T", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + out: false, + + range: [8, 18], + loc: { + start: { column: 8, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [7, 19], + loc: { + start: { column: 7, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [0, 22], + loc: { + start: { column: 0, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..f2e380c19dd --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-const-in-modifier TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "E", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [8, 13], + loc: { + start: { column: 8, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [14, 16], + loc: { + start: { column: 14, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..422530d039c --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/3-Babel-AST.shot @@ -0,0 +1,69 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-const-in-modifier Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [20, 22], + loc: { + start: { column: 20, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "E", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: true, + name: "T", + + range: [8, 18], + loc: { + start: { column: 8, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [7, 19], + loc: { + start: { column: 7, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [0, 22], + loc: { + start: { column: 0, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..6abbc6c549e --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-const-in-modifier Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "E", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [8, 13], + loc: { + start: { column: 8, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [14, 16], + loc: { + start: { column: 14, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..b8aa62a507c --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,84 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-const-in-modifier AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [20, 22], + loc: { + start: { column: 20, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'E', + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + const: true, + in: true, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [17, 18], +- loc: { +- start: { column: 17, line: 1 }, +- end: { column: 18, line: 1 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [8, 18], + loc: { + start: { column: 8, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [7, 19], + loc: { + start: { column: 7, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [0, 22], + loc: { + start: { column: 0, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..28f1e6988ff --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-const-in-modifier AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/fixture.ts new file mode 100644 index 00000000000..ccc2587d9d0 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/fixture.ts @@ -0,0 +1 @@ +class B {} diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..a31ab33ed3a --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,98 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier-extends TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [27, 29], + loc: { + start: { column: 27, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "B", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + constraint: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + out: false, + + range: [8, 25], + loc: { + start: { column: 8, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + ], + + range: [7, 26], + loc: { + start: { column: 7, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..cdea319464d --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier-extends TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [8, 13], + loc: { + start: { column: 8, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [16, 23], + loc: { + start: { column: 16, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..f1530945fe0 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/3-Babel-AST.shot @@ -0,0 +1,87 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier-extends Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [27, 29], + loc: { + start: { column: 27, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "B", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + constraint: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + name: "T", + + range: [8, 25], + loc: { + start: { column: 8, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + ], + + range: [7, 26], + loc: { + start: { column: 7, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..3fd9f064797 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier-extends Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [8, 13], + loc: { + start: { column: 8, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [16, 23], + loc: { + start: { column: 16, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..6b9faf086d6 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,103 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier-extends AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [27, 29], + loc: { + start: { column: 27, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'B', + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + const: true, + constraint: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'U', + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [14, 15], +- loc: { +- start: { column: 14, line: 1 }, +- end: { column: 15, line: 1 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [8, 25], + loc: { + start: { column: 8, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + ], + + range: [7, 26], + loc: { + start: { column: 7, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..eeff4a27337 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier-extends AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/fixture.ts new file mode 100644 index 00000000000..20dc9a333da --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/fixture.ts @@ -0,0 +1 @@ +class C {} diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..690ad079a69 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,101 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier-multiple TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [20, 22], + loc: { + start: { column: 20, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "C", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: false, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + out: false, + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: false, + name: Identifier { + type: "Identifier", + name: "U", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + out: false, + + range: [11, 18], + loc: { + start: { column: 11, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [7, 19], + loc: { + start: { column: 7, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [0, 22], + loc: { + start: { column: 0, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..b54ca39a613 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier-multiple TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [11, 16], + loc: { + start: { column: 11, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..f2a92ee1a31 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/3-Babel-AST.shot @@ -0,0 +1,78 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier-multiple Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [20, 22], + loc: { + start: { column: 20, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "C", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + TSTypeParameter { + type: "TSTypeParameter", + const: true, + name: "U", + + range: [11, 18], + loc: { + start: { column: 11, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [7, 19], + loc: { + start: { column: 7, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [0, 22], + loc: { + start: { column: 0, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..2245d514cb7 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier-multiple Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "C", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [11, 16], + loc: { + start: { column: 11, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..274981ae125 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,107 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier-multiple AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [20, 22], + loc: { + start: { column: 20, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'C', + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- const: false, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', ++ name: 'T', + +- range: [8, 9], +- loc: { +- start: { column: 8, line: 1 }, +- end: { column: 9, line: 1 }, +- }, +- }, +- out: false, +- + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + TSTypeParameter { + type: 'TSTypeParameter', + const: true, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'U', +- +- range: [17, 18], +- loc: { +- start: { column: 17, line: 1 }, +- end: { column: 18, line: 1 }, +- }, +- }, +- out: false, ++ name: 'U', + + range: [11, 18], + loc: { + start: { column: 11, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [7, 19], + loc: { + start: { column: 7, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [0, 22], + loc: { + start: { column: 0, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..c5dac045eb0 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier-multiple AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/fixture.ts new file mode 100644 index 00000000000..41a67eea326 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/fixture.ts @@ -0,0 +1 @@ +class A {} diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..52825106e0d --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,79 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [17, 19], + loc: { + start: { column: 17, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "A", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + out: false, + + range: [8, 15], + loc: { + start: { column: 8, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + ], + + range: [7, 16], + loc: { + start: { column: 7, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + + range: [0, 19], + loc: { + start: { column: 0, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 20], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..ee3a6611f44 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [8, 13], + loc: { + start: { column: 8, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..5220f23ce44 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/3-Babel-AST.shot @@ -0,0 +1,68 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [17, 19], + loc: { + start: { column: 17, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "A", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + name: "T", + + range: [8, 15], + loc: { + start: { column: 8, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + ], + + range: [7, 16], + loc: { + start: { column: 7, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + + range: [0, 19], + loc: { + start: { column: 0, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 20], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..83faac7304e --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [8, 13], + loc: { + start: { column: 8, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..27b0483a19b --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,84 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [17, 19], + loc: { + start: { column: 17, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'A', + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + const: true, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [14, 15], +- loc: { +- start: { column: 14, line: 1 }, +- end: { column: 15, line: 1 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [8, 15], + loc: { + start: { column: 8, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + ], + + range: [7, 16], + loc: { + start: { column: 7, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + + range: [0, 19], + loc: { + start: { column: 0, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 20], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..f520c9957e1 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/fixture.ts new file mode 100644 index 00000000000..046c0ebea35 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/fixture.ts @@ -0,0 +1 @@ +class D {} diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..3cf992b0857 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,79 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-in-const-modifier TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [20, 22], + loc: { + start: { column: 20, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "D", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: true, + name: Identifier { + type: "Identifier", + name: "T", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + out: false, + + range: [8, 18], + loc: { + start: { column: 8, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [7, 19], + loc: { + start: { column: 7, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [0, 22], + loc: { + start: { column: 0, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..cc9e9adc232 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-in-const-modifier TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "D", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [8, 10], + loc: { + start: { column: 8, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [11, 16], + loc: { + start: { column: 11, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..a1f230b755d --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/3-Babel-AST.shot @@ -0,0 +1,69 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-in-const-modifier Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [20, 22], + loc: { + start: { column: 20, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "D", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: true, + name: "T", + + range: [8, 18], + loc: { + start: { column: 8, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [7, 19], + loc: { + start: { column: 7, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [0, 22], + loc: { + start: { column: 0, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..8c2ed4d12b7 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-in-const-modifier Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "D", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [8, 10], + loc: { + start: { column: 8, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [11, 16], + loc: { + start: { column: 11, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..f6ed4a29e37 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,84 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-in-const-modifier AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [20, 22], + loc: { + start: { column: 20, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'D', + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + const: true, + in: true, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [17, 18], +- loc: { +- start: { column: 17, line: 1 }, +- end: { column: 18, line: 1 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [8, 18], + loc: { + start: { column: 8, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [7, 19], + loc: { + start: { column: 7, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [0, 22], + loc: { + start: { column: 0, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..00026112623 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-decl-in-const-modifier AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/fixture.ts new file mode 100644 index 00000000000..7a02fba4302 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/fixture.ts @@ -0,0 +1 @@ +(class {}); diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..8d185f20e56 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,79 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-const-in-modifier TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ClassExpression { + type: "ClassExpression", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [20, 22], + loc: { + start: { column: 20, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + id: null, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: true, + name: Identifier { + type: "Identifier", + name: "T", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + out: false, + + range: [8, 18], + loc: { + start: { column: 8, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [7, 19], + loc: { + start: { column: 7, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [1, 22], + loc: { + start: { column: 1, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..72be2d9bf95 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-const-in-modifier TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [1, 6], + loc: { + start: { column: 1, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [8, 13], + loc: { + start: { column: 8, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [14, 16], + loc: { + start: { column: 14, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..8c6a13cf385 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/3-Babel-AST.shot @@ -0,0 +1,69 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-const-in-modifier Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ClassExpression { + type: "ClassExpression", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [20, 22], + loc: { + start: { column: 20, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + id: null, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: true, + name: "T", + + range: [8, 18], + loc: { + start: { column: 8, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [7, 19], + loc: { + start: { column: 7, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [1, 22], + loc: { + start: { column: 1, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..e4633d22a4f --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-const-in-modifier Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [1, 6], + loc: { + start: { column: 1, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [8, 13], + loc: { + start: { column: 8, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [14, 16], + loc: { + start: { column: 14, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..d212dd9308f --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,84 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-const-in-modifier AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExpressionStatement { + type: 'ExpressionStatement', + expression: ClassExpression { + type: 'ClassExpression', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [20, 22], + loc: { + start: { column: 20, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + id: null, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + const: true, + in: true, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [17, 18], +- loc: { +- start: { column: 17, line: 1 }, +- end: { column: 18, line: 1 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [8, 18], + loc: { + start: { column: 8, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [7, 19], + loc: { + start: { column: 7, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [1, 22], + loc: { + start: { column: 1, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..fd592298c03 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-const-in-modifier AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/fixture.ts new file mode 100644 index 00000000000..cd6ecc95bec --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/fixture.ts @@ -0,0 +1 @@ +(class {}); diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..6b0bdc7a2bf --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,98 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-extends TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ClassExpression { + type: "ClassExpression", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [27, 29], + loc: { + start: { column: 27, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + id: null, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + constraint: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + out: false, + + range: [8, 25], + loc: { + start: { column: 8, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + ], + + range: [7, 26], + loc: { + start: { column: 7, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + + range: [1, 29], + loc: { + start: { column: 1, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..6cc630de9e0 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-extends TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [1, 6], + loc: { + start: { column: 1, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [8, 13], + loc: { + start: { column: 8, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [16, 23], + loc: { + start: { column: 16, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..5fe5b59605e --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/3-Babel-AST.shot @@ -0,0 +1,87 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-extends Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ClassExpression { + type: "ClassExpression", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [27, 29], + loc: { + start: { column: 27, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + id: null, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + constraint: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + name: "T", + + range: [8, 25], + loc: { + start: { column: 8, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + ], + + range: [7, 26], + loc: { + start: { column: 7, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + + range: [1, 29], + loc: { + start: { column: 1, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..6ac0b40cf56 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-extends Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [1, 6], + loc: { + start: { column: 1, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [8, 13], + loc: { + start: { column: 8, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [16, 23], + loc: { + start: { column: 16, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..3d17a9cdd49 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,103 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-extends AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExpressionStatement { + type: 'ExpressionStatement', + expression: ClassExpression { + type: 'ClassExpression', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [27, 29], + loc: { + start: { column: 27, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + id: null, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + const: true, + constraint: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'U', + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [14, 15], +- loc: { +- start: { column: 14, line: 1 }, +- end: { column: 15, line: 1 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [8, 25], + loc: { + start: { column: 8, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + ], + + range: [7, 26], + loc: { + start: { column: 7, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + + range: [1, 29], + loc: { + start: { column: 1, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..958efeb49a1 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-extends AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/fixture.ts new file mode 100644 index 00000000000..a0fd2dc36d9 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/fixture.ts @@ -0,0 +1 @@ +(class {}); diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..eea3aa66bb9 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,101 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-multiple TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ClassExpression { + type: "ClassExpression", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [20, 22], + loc: { + start: { column: 20, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + id: null, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: false, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + out: false, + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: false, + name: Identifier { + type: "Identifier", + name: "U", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + out: false, + + range: [11, 18], + loc: { + start: { column: 11, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [7, 19], + loc: { + start: { column: 7, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [1, 22], + loc: { + start: { column: 1, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..e01a5b533d1 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-multiple TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [1, 6], + loc: { + start: { column: 1, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [11, 16], + loc: { + start: { column: 11, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..7c778a6bcfc --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/3-Babel-AST.shot @@ -0,0 +1,78 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-multiple Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ClassExpression { + type: "ClassExpression", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [20, 22], + loc: { + start: { column: 20, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + id: null, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + TSTypeParameter { + type: "TSTypeParameter", + const: true, + name: "U", + + range: [11, 18], + loc: { + start: { column: 11, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [7, 19], + loc: { + start: { column: 7, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [1, 22], + loc: { + start: { column: 1, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..c14e3072809 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-multiple Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [1, 6], + loc: { + start: { column: 1, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [11, 16], + loc: { + start: { column: 11, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..b6d1dee5b19 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,107 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-multiple AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExpressionStatement { + type: 'ExpressionStatement', + expression: ClassExpression { + type: 'ClassExpression', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [20, 22], + loc: { + start: { column: 20, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + id: null, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- const: false, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', ++ name: 'T', + +- range: [8, 9], +- loc: { +- start: { column: 8, line: 1 }, +- end: { column: 9, line: 1 }, +- }, +- }, +- out: false, +- + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + TSTypeParameter { + type: 'TSTypeParameter', + const: true, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'U', +- +- range: [17, 18], +- loc: { +- start: { column: 17, line: 1 }, +- end: { column: 18, line: 1 }, +- }, +- }, +- out: false, ++ name: 'U', + + range: [11, 18], + loc: { + start: { column: 11, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [7, 19], + loc: { + start: { column: 7, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [1, 22], + loc: { + start: { column: 1, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..64789f76ca4 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-multiple AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/fixture.ts new file mode 100644 index 00000000000..e7c0e459e69 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/fixture.ts @@ -0,0 +1 @@ +(class {}); diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..33256b778c3 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,79 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ClassExpression { + type: "ClassExpression", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [17, 19], + loc: { + start: { column: 17, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + id: null, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + out: false, + + range: [8, 15], + loc: { + start: { column: 8, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + ], + + range: [7, 16], + loc: { + start: { column: 7, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + + range: [1, 19], + loc: { + start: { column: 1, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [0, 21], + loc: { + start: { column: 0, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 22], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..3811f6f336d --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [1, 6], + loc: { + start: { column: 1, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [8, 13], + loc: { + start: { column: 8, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..dd822ac4a93 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/3-Babel-AST.shot @@ -0,0 +1,68 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ClassExpression { + type: "ClassExpression", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [17, 19], + loc: { + start: { column: 17, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + id: null, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + name: "T", + + range: [8, 15], + loc: { + start: { column: 8, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + ], + + range: [7, 16], + loc: { + start: { column: 7, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + + range: [1, 19], + loc: { + start: { column: 1, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [0, 21], + loc: { + start: { column: 0, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 22], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..63d8766b2e1 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [1, 6], + loc: { + start: { column: 1, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [8, 13], + loc: { + start: { column: 8, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..2363475fdb4 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,84 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExpressionStatement { + type: 'ExpressionStatement', + expression: ClassExpression { + type: 'ClassExpression', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [17, 19], + loc: { + start: { column: 17, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + id: null, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + const: true, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [14, 15], +- loc: { +- start: { column: 14, line: 1 }, +- end: { column: 15, line: 1 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [8, 15], + loc: { + start: { column: 8, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + ], + + range: [7, 16], + loc: { + start: { column: 7, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + + range: [1, 19], + loc: { + start: { column: 1, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [0, 21], + loc: { + start: { column: 0, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 22], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..e0ae36e4faa --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/fixture.ts new file mode 100644 index 00000000000..eb21599bf3b --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/fixture.ts @@ -0,0 +1 @@ +(class {}); diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..fcffd0b8c92 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,79 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-in-const-modifier TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ClassExpression { + type: "ClassExpression", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [20, 22], + loc: { + start: { column: 20, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + id: null, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: true, + name: Identifier { + type: "Identifier", + name: "T", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + out: false, + + range: [8, 18], + loc: { + start: { column: 8, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [7, 19], + loc: { + start: { column: 7, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [1, 22], + loc: { + start: { column: 1, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..10da065d45e --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-in-const-modifier TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [1, 6], + loc: { + start: { column: 1, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [8, 10], + loc: { + start: { column: 8, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [11, 16], + loc: { + start: { column: 11, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..be63bfbe539 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/3-Babel-AST.shot @@ -0,0 +1,69 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-in-const-modifier Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ClassExpression { + type: "ClassExpression", + body: ClassBody { + type: "ClassBody", + body: Array [], + + range: [20, 22], + loc: { + start: { column: 20, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + id: null, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: true, + name: "T", + + range: [8, 18], + loc: { + start: { column: 8, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [7, 19], + loc: { + start: { column: 7, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [1, 22], + loc: { + start: { column: 1, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..a9c914863e5 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-in-const-modifier Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [1, 6], + loc: { + start: { column: 1, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [8, 10], + loc: { + start: { column: 8, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [11, 16], + loc: { + start: { column: 11, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..f3f3121a24c --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,84 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-in-const-modifier AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExpressionStatement { + type: 'ExpressionStatement', + expression: ClassExpression { + type: 'ClassExpression', + body: ClassBody { + type: 'ClassBody', + body: Array [], + + range: [20, 22], + loc: { + start: { column: 20, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + id: null, + superClass: null, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + const: true, + in: true, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [17, 18], +- loc: { +- start: { column: 17, line: 1 }, +- end: { column: 18, line: 1 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [8, 18], + loc: { + start: { column: 8, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [7, 19], + loc: { + start: { column: 7, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [1, 22], + loc: { + start: { column: 1, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..f56069113d3 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter class-expr-in-const-modifier AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/fixture.ts new file mode 100644 index 00000000000..64a3bb41755 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/fixture.ts @@ -0,0 +1 @@ +declare function d(); diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..08cb4c0d8ce --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,73 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter declare-func-const-modifier TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSDeclareFunction { + type: "TSDeclareFunction", + async: false, + declare: true, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "d", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + out: false, + + range: [19, 26], + loc: { + start: { column: 19, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ], + + range: [18, 27], + loc: { + start: { column: 18, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..fca04917942 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter declare-func-const-modifier TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [0, 7], + loc: { + start: { column: 0, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [8, 16], + loc: { + start: { column: 8, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "d", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [19, 24], + loc: { + start: { column: 19, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..56ce8e8fbb7 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/3-Babel-AST.shot @@ -0,0 +1,62 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter declare-func-const-modifier Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSDeclareFunction { + type: "TSDeclareFunction", + async: false, + declare: true, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "d", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + name: "T", + + range: [19, 26], + loc: { + start: { column: 19, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ], + + range: [18, 27], + loc: { + start: { column: 18, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..4e67a63ce2e --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter declare-func-const-modifier Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "declare", + + range: [0, 7], + loc: { + start: { column: 0, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [8, 16], + loc: { + start: { column: 8, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "d", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [19, 24], + loc: { + start: { column: 19, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..15e908f2a61 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,78 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter declare-func-const-modifier AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSDeclareFunction { + type: 'TSDeclareFunction', + async: false, + declare: true, + expression: false, + generator: false, + id: Identifier { + type: 'Identifier', + name: 'd', + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + const: true, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [25, 26], +- loc: { +- start: { column: 25, line: 1 }, +- end: { column: 26, line: 1 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [19, 26], + loc: { + start: { column: 19, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ], + + range: [18, 27], + loc: { + start: { column: 18, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..ae8d720d1e0 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter declare-func-const-modifier AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/fixture.ts new file mode 100644 index 00000000000..4890237a6c9 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/fixture.ts @@ -0,0 +1 @@ +function b() {} diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..12df729c721 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,101 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier-extends TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [32, 34], + loc: { + start: { column: 32, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "b", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + constraint: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + out: false, + + range: [11, 28], + loc: { + start: { column: 11, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + ], + + range: [10, 29], + loc: { + start: { column: 10, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [0, 34], + loc: { + start: { column: 0, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 35], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..1b7875fbe5f --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier-extends TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [11, 16], + loc: { + start: { column: 11, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [19, 26], + loc: { + start: { column: 19, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [32, 33], + loc: { + start: { column: 32, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [33, 34], + loc: { + start: { column: 33, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..12e8654b2df --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/3-Babel-AST.shot @@ -0,0 +1,90 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier-extends Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [32, 34], + loc: { + start: { column: 32, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "b", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + constraint: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + name: "T", + + range: [11, 28], + loc: { + start: { column: 11, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + ], + + range: [10, 29], + loc: { + start: { column: 10, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [0, 34], + loc: { + start: { column: 0, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 35], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..0ebba700612 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier-extends Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [11, 16], + loc: { + start: { column: 11, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [19, 26], + loc: { + start: { column: 19, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [32, 33], + loc: { + start: { column: 32, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [33, 34], + loc: { + start: { column: 33, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..737f0d3abc7 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier-extends AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + FunctionDeclaration { + type: 'FunctionDeclaration', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [32, 34], + loc: { + start: { column: 32, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: 'Identifier', + name: 'b', + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + const: true, + constraint: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'U', + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [17, 18], +- loc: { +- start: { column: 17, line: 1 }, +- end: { column: 18, line: 1 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [11, 28], + loc: { + start: { column: 11, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + ], + + range: [10, 29], + loc: { + start: { column: 10, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [0, 34], + loc: { + start: { column: 0, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 35], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..fa763010222 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier-extends AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/fixture.ts new file mode 100644 index 00000000000..210ce695b01 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/fixture.ts @@ -0,0 +1 @@ +function c() {} diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..6068e997500 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,104 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier-multiple TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [25, 27], + loc: { + start: { column: 25, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "c", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: false, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + out: false, + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: false, + name: Identifier { + type: "Identifier", + name: "U", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + out: false, + + range: [14, 21], + loc: { + start: { column: 14, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + ], + + range: [10, 22], + loc: { + start: { column: 10, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..c86b697b908 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier-multiple TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "c", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [14, 19], + loc: { + start: { column: 14, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..f6da4949e06 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/3-Babel-AST.shot @@ -0,0 +1,81 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier-multiple Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [25, 27], + loc: { + start: { column: 25, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "c", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + TSTypeParameter { + type: "TSTypeParameter", + const: true, + name: "U", + + range: [14, 21], + loc: { + start: { column: 14, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + ], + + range: [10, 22], + loc: { + start: { column: 10, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..9771e4d1bed --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier-multiple Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "c", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [14, 19], + loc: { + start: { column: 14, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..eba1adb09f4 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,110 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier-multiple AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + FunctionDeclaration { + type: 'FunctionDeclaration', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [25, 27], + loc: { + start: { column: 25, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: 'Identifier', + name: 'c', + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- const: false, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', ++ name: 'T', + +- range: [11, 12], +- loc: { +- start: { column: 11, line: 1 }, +- end: { column: 12, line: 1 }, +- }, +- }, +- out: false, +- + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + TSTypeParameter { + type: 'TSTypeParameter', + const: true, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'U', +- +- range: [20, 21], +- loc: { +- start: { column: 20, line: 1 }, +- end: { column: 21, line: 1 }, +- }, +- }, +- out: false, ++ name: 'U', + + range: [14, 21], + loc: { + start: { column: 14, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + ], + + range: [10, 22], + loc: { + start: { column: 10, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..f694d610839 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier-multiple AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/fixture.ts new file mode 100644 index 00000000000..ed2db338e0d --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/fixture.ts @@ -0,0 +1 @@ +function a() {} diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..933e7b9dc03 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,82 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [22, 24], + loc: { + start: { column: 22, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + out: false, + + range: [11, 18], + loc: { + start: { column: 11, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [10, 19], + loc: { + start: { column: 10, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..da988d004a4 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [11, 16], + loc: { + start: { column: 11, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..882e37dbb44 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/3-Babel-AST.shot @@ -0,0 +1,71 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + FunctionDeclaration { + type: "FunctionDeclaration", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [22, 24], + loc: { + start: { column: 22, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: "Identifier", + name: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + name: "T", + + range: [11, 18], + loc: { + start: { column: 11, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [10, 19], + loc: { + start: { column: 10, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..7fb17b6a709 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "function", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [11, 16], + loc: { + start: { column: 11, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..71ee0e188f1 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,87 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + FunctionDeclaration { + type: 'FunctionDeclaration', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [22, 24], + loc: { + start: { column: 22, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + expression: false, + generator: false, + id: Identifier { + type: 'Identifier', + name: 'a', + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + const: true, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [17, 18], +- loc: { +- start: { column: 17, line: 1 }, +- end: { column: 18, line: 1 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [11, 18], + loc: { + start: { column: 11, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [10, 19], + loc: { + start: { column: 10, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..08d9c0b92f1 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/fixture.ts new file mode 100644 index 00000000000..956e8a53eb9 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/fixture.ts @@ -0,0 +1 @@ +(function () {}); diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..6c8b5394aa1 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,101 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier-extends TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [32, 34], + loc: { + start: { column: 32, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + constraint: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + out: false, + + range: [11, 28], + loc: { + start: { column: 11, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + ], + + range: [10, 29], + loc: { + start: { column: 10, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [1, 34], + loc: { + start: { column: 1, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + + range: [0, 36], + loc: { + start: { column: 0, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 37], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..681e30413be --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier-extends TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [1, 9], + loc: { + start: { column: 1, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [11, 16], + loc: { + start: { column: 11, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [19, 26], + loc: { + start: { column: 19, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [32, 33], + loc: { + start: { column: 32, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [33, 34], + loc: { + start: { column: 33, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [34, 35], + loc: { + start: { column: 34, line: 1 }, + end: { column: 35, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [35, 36], + loc: { + start: { column: 35, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..7c6f2a7b1b6 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/3-Babel-AST.shot @@ -0,0 +1,90 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier-extends Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [32, 34], + loc: { + start: { column: 32, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + constraint: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + name: "T", + + range: [11, 28], + loc: { + start: { column: 11, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + ], + + range: [10, 29], + loc: { + start: { column: 10, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [1, 34], + loc: { + start: { column: 1, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + + range: [0, 36], + loc: { + start: { column: 0, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 37], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..98e9fe2a75d --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier-extends Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [1, 9], + loc: { + start: { column: 1, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [11, 16], + loc: { + start: { column: 11, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [19, 26], + loc: { + start: { column: 19, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [32, 33], + loc: { + start: { column: 32, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [33, 34], + loc: { + start: { column: 33, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [34, 35], + loc: { + start: { column: 34, line: 1 }, + end: { column: 35, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [35, 36], + loc: { + start: { column: 35, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..64cbd211b5d --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier-extends AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExpressionStatement { + type: 'ExpressionStatement', + expression: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [32, 34], + loc: { + start: { column: 32, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + const: true, + constraint: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'U', + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [17, 18], +- loc: { +- start: { column: 17, line: 1 }, +- end: { column: 18, line: 1 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [11, 28], + loc: { + start: { column: 11, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + ], + + range: [10, 29], + loc: { + start: { column: 10, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [1, 34], + loc: { + start: { column: 1, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + + range: [0, 36], + loc: { + start: { column: 0, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 37], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..80c919e9a1c --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier-extends AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/fixture.ts new file mode 100644 index 00000000000..7fa1dc543ca --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/fixture.ts @@ -0,0 +1 @@ +(function () {}); diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..a6bf6f0d28d --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,104 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier-multiple TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [25, 27], + loc: { + start: { column: 25, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: false, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + out: false, + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: false, + name: Identifier { + type: "Identifier", + name: "U", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + out: false, + + range: [14, 21], + loc: { + start: { column: 14, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + ], + + range: [10, 22], + loc: { + start: { column: 10, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + + range: [1, 27], + loc: { + start: { column: 1, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..3bd2ede9054 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier-multiple TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [1, 9], + loc: { + start: { column: 1, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [14, 19], + loc: { + start: { column: 14, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..99989558e4e --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/3-Babel-AST.shot @@ -0,0 +1,81 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier-multiple Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [25, 27], + loc: { + start: { column: 25, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + TSTypeParameter { + type: "TSTypeParameter", + const: true, + name: "U", + + range: [14, 21], + loc: { + start: { column: 14, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + ], + + range: [10, 22], + loc: { + start: { column: 10, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + + range: [1, 27], + loc: { + start: { column: 1, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..17ba38de713 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier-multiple Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [1, 9], + loc: { + start: { column: 1, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [14, 19], + loc: { + start: { column: 14, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..2a50d483de2 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,110 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier-multiple AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExpressionStatement { + type: 'ExpressionStatement', + expression: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [25, 27], + loc: { + start: { column: 25, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- const: false, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', ++ name: 'T', + +- range: [11, 12], +- loc: { +- start: { column: 11, line: 1 }, +- end: { column: 12, line: 1 }, +- }, +- }, +- out: false, +- + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + TSTypeParameter { + type: 'TSTypeParameter', + const: true, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'U', +- +- range: [20, 21], +- loc: { +- start: { column: 20, line: 1 }, +- end: { column: 21, line: 1 }, +- }, +- }, +- out: false, ++ name: 'U', + + range: [14, 21], + loc: { + start: { column: 14, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + ], + + range: [10, 22], + loc: { + start: { column: 10, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + + range: [1, 27], + loc: { + start: { column: 1, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..e5a3f88961e --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier-multiple AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/fixture.ts new file mode 100644 index 00000000000..a0f0b5dda21 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/fixture.ts @@ -0,0 +1 @@ +(function () {}); diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..877b212c574 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,82 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [22, 24], + loc: { + start: { column: 22, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + out: false, + + range: [11, 18], + loc: { + start: { column: 11, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [10, 19], + loc: { + start: { column: 10, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [1, 24], + loc: { + start: { column: 1, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + + range: [0, 26], + loc: { + start: { column: 0, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..e27c4c4e721 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [1, 9], + loc: { + start: { column: 1, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [11, 16], + loc: { + start: { column: 11, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..41db13981ed --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/3-Babel-AST.shot @@ -0,0 +1,71 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [22, 24], + loc: { + start: { column: 22, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + name: "T", + + range: [11, 18], + loc: { + start: { column: 11, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [10, 19], + loc: { + start: { column: 10, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [1, 24], + loc: { + start: { column: 1, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + + range: [0, 26], + loc: { + start: { column: 0, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..d5170f6f5c3 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "function", + + range: [1, 9], + loc: { + start: { column: 1, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [11, 16], + loc: { + start: { column: 11, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [17, 18], + loc: { + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..a5476c5645a --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,87 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExpressionStatement { + type: 'ExpressionStatement', + expression: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [22, 24], + loc: { + start: { column: 22, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + const: true, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [17, 18], +- loc: { +- start: { column: 17, line: 1 }, +- end: { column: 18, line: 1 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [11, 18], + loc: { + start: { column: 11, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + ], + + range: [10, 19], + loc: { + start: { column: 10, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [1, 24], + loc: { + start: { column: 1, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + + range: [0, 26], + loc: { + start: { column: 0, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..c3e5830fb8b --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/fixture.ts new file mode 100644 index 00000000000..14025fb6fd5 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/fixture.ts @@ -0,0 +1 @@ +interface M {} diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..08244df8343 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,78 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-const-in-modifier-multiple TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [24, 26], + loc: { + start: { column: 24, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "M", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: true, + name: Identifier { + type: "Identifier", + name: "T", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + out: false, + + range: [12, 22], + loc: { + start: { column: 12, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + + range: [11, 23], + loc: { + start: { column: 11, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + + range: [0, 26], + loc: { + start: { column: 0, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..ec23b39aefb --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-const-in-modifier-multiple TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "interface", + + range: [0, 9], + loc: { + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "M", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [12, 17], + loc: { + start: { column: 12, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [18, 20], + loc: { + start: { column: 18, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..3ba533c5899 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/3-Babel-AST.shot @@ -0,0 +1,68 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-const-in-modifier-multiple Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [24, 26], + loc: { + start: { column: 24, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "M", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: true, + name: "T", + + range: [12, 22], + loc: { + start: { column: 12, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + + range: [11, 23], + loc: { + start: { column: 11, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + + range: [0, 26], + loc: { + start: { column: 0, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..dd79b1ba3cd --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-const-in-modifier-multiple Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "interface", + + range: [0, 9], + loc: { + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "M", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [12, 17], + loc: { + start: { column: 12, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [18, 20], + loc: { + start: { column: 18, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..4add40cf5d1 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,83 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-const-in-modifier-multiple AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [], + + range: [24, 26], + loc: { + start: { column: 24, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'M', + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + const: true, + in: true, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [21, 22], +- loc: { +- start: { column: 21, line: 1 }, +- end: { column: 22, line: 1 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [12, 22], + loc: { + start: { column: 12, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + + range: [11, 23], + loc: { + start: { column: 11, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + + range: [0, 26], + loc: { + start: { column: 0, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..9c4fc733e26 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,102 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-const-in-modifier-multiple AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [0, 9], + loc: { + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'M', + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [12, 17], + loc: { + start: { column: 12, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'in', + + range: [18, 20], + loc: { + start: { column: 18, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/fixture.ts new file mode 100644 index 00000000000..039606144f1 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/fixture.ts @@ -0,0 +1 @@ +interface J {} diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..25ee3807734 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,97 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-const-modifier-extends TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [31, 33], + loc: { + start: { column: 31, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "J", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + constraint: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + out: false, + + range: [12, 29], + loc: { + start: { column: 12, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + + range: [11, 30], + loc: { + start: { column: 11, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 34], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..e484e1a896e --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-const-modifier-extends TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "interface", + + range: [0, 9], + loc: { + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "J", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [12, 17], + loc: { + start: { column: 12, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [20, 27], + loc: { + start: { column: 20, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [31, 32], + loc: { + start: { column: 31, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [32, 33], + loc: { + start: { column: 32, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..e07e4c12960 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/3-Babel-AST.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-const-modifier-extends Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [31, 33], + loc: { + start: { column: 31, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "J", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + constraint: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + name: "T", + + range: [12, 29], + loc: { + start: { column: 12, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + + range: [11, 30], + loc: { + start: { column: 11, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 34], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..83a3d9ecbc6 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-const-modifier-extends Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "interface", + + range: [0, 9], + loc: { + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "J", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [12, 17], + loc: { + start: { column: 12, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [20, 27], + loc: { + start: { column: 20, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [31, 32], + loc: { + start: { column: 31, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [32, 33], + loc: { + start: { column: 32, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..47c6ccd25b6 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,102 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-const-modifier-extends AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [], + + range: [31, 33], + loc: { + start: { column: 31, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'J', + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + const: true, + constraint: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'U', + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [18, 19], +- loc: { +- start: { column: 18, line: 1 }, +- end: { column: 19, line: 1 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [12, 29], + loc: { + start: { column: 12, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + + range: [11, 30], + loc: { + start: { column: 11, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 34], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..8ca3d093cdb --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,112 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-const-modifier-extends AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [0, 9], + loc: { + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'J', + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [12, 17], + loc: { + start: { column: 12, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'extends', + + range: [20, 27], + loc: { + start: { column: 20, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'U', + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [31, 32], + loc: { + start: { column: 31, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [32, 33], + loc: { + start: { column: 32, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/fixture.ts new file mode 100644 index 00000000000..6c8c019b3bd --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/fixture.ts @@ -0,0 +1 @@ +interface I {} diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..99e68cb460e --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,100 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-const-modifier-multiple TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [24, 26], + loc: { + start: { column: 24, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "I", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: false, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + out: false, + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + out: false, + + range: [15, 22], + loc: { + start: { column: 15, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + + range: [11, 23], + loc: { + start: { column: 11, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + + range: [0, 26], + loc: { + start: { column: 0, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..ba0f13bfa7a --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-const-modifier-multiple TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "interface", + + range: [0, 9], + loc: { + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "I", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [13, 14], + loc: { + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [15, 20], + loc: { + start: { column: 15, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..4074fcf6f51 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/3-Babel-AST.shot @@ -0,0 +1,77 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-const-modifier-multiple Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [24, 26], + loc: { + start: { column: 24, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "I", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + TSTypeParameter { + type: "TSTypeParameter", + const: true, + name: "T", + + range: [15, 22], + loc: { + start: { column: 15, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + + range: [11, 23], + loc: { + start: { column: 11, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + + range: [0, 26], + loc: { + start: { column: 0, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..484ffd2241f --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-const-modifier-multiple Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "interface", + + range: [0, 9], + loc: { + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "I", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [13, 14], + loc: { + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [15, 20], + loc: { + start: { column: 15, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..80b85b253f0 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-const-modifier-multiple AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [], + + range: [24, 26], + loc: { + start: { column: 24, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'I', + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- const: false, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', ++ name: 'T', + +- range: [12, 13], +- loc: { +- start: { column: 12, line: 1 }, +- end: { column: 13, line: 1 }, +- }, +- }, +- out: false, +- + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + TSTypeParameter { + type: 'TSTypeParameter', + const: true, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [21, 22], +- loc: { +- start: { column: 21, line: 1 }, +- end: { column: 22, line: 1 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [15, 22], + loc: { + start: { column: 15, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + + range: [11, 23], + loc: { + start: { column: 11, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + + range: [0, 26], + loc: { + start: { column: 0, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..87b3bd7d473 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,112 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-const-modifier-multiple AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [0, 9], + loc: { + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'I', + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [13, 14], + loc: { + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [15, 20], + loc: { + start: { column: 15, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/fixture.ts new file mode 100644 index 00000000000..b39faab878a --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/fixture.ts @@ -0,0 +1 @@ +interface I {} diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..c05151d3237 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,78 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-const-modifier TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [21, 23], + loc: { + start: { column: 21, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "I", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + out: false, + + range: [12, 19], + loc: { + start: { column: 12, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + ], + + range: [11, 20], + loc: { + start: { column: 11, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..43d078d4e55 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-const-modifier TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "interface", + + range: [0, 9], + loc: { + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "I", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [12, 17], + loc: { + start: { column: 12, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..349b9c261c5 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/3-Babel-AST.shot @@ -0,0 +1,67 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-const-modifier Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [21, 23], + loc: { + start: { column: 21, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "I", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + name: "T", + + range: [12, 19], + loc: { + start: { column: 12, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + ], + + range: [11, 20], + loc: { + start: { column: 11, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..468d542ddc6 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-const-modifier Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "interface", + + range: [0, 9], + loc: { + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "I", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [12, 17], + loc: { + start: { column: 12, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..f24056fd5d6 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,83 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-const-modifier AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [], + + range: [21, 23], + loc: { + start: { column: 21, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'I', + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + const: true, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [18, 19], +- loc: { +- start: { column: 18, line: 1 }, +- end: { column: 19, line: 1 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [12, 19], + loc: { + start: { column: 12, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + ], + + range: [11, 20], + loc: { + start: { column: 11, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..7e76e050826 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,92 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-const-modifier AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [0, 9], + loc: { + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'I', + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [12, 17], + loc: { + start: { column: 12, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/fixture.ts new file mode 100644 index 00000000000..8dc6e2f6033 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/fixture.ts @@ -0,0 +1 @@ +interface L {} diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..67eee83add5 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,78 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-in-const-modifier-multiple TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [24, 26], + loc: { + start: { column: 24, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "L", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: true, + name: Identifier { + type: "Identifier", + name: "T", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + out: false, + + range: [12, 22], + loc: { + start: { column: 12, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + + range: [11, 23], + loc: { + start: { column: 11, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + + range: [0, 26], + loc: { + start: { column: 0, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..315b7d12587 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-in-const-modifier-multiple TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "interface", + + range: [0, 9], + loc: { + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "L", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [12, 14], + loc: { + start: { column: 12, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [15, 20], + loc: { + start: { column: 15, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..8927bc9e655 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/3-Babel-AST.shot @@ -0,0 +1,68 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-in-const-modifier-multiple Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + TSInterfaceDeclaration { + type: "TSInterfaceDeclaration", + body: TSInterfaceBody { + type: "TSInterfaceBody", + body: Array [], + + range: [24, 26], + loc: { + start: { column: 24, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "L", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: true, + name: "T", + + range: [12, 22], + loc: { + start: { column: 12, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + + range: [11, 23], + loc: { + start: { column: 11, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + + range: [0, 26], + loc: { + start: { column: 0, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..d44d5cef762 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-in-const-modifier-multiple Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "interface", + + range: [0, 9], + loc: { + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "L", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "in", + + range: [12, 14], + loc: { + start: { column: 12, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [15, 20], + loc: { + start: { column: 15, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..3579f6bbe03 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,83 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-in-const-modifier-multiple AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + TSInterfaceDeclaration { + type: 'TSInterfaceDeclaration', + body: TSInterfaceBody { + type: 'TSInterfaceBody', + body: Array [], + + range: [24, 26], + loc: { + start: { column: 24, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'L', + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + const: true, + in: true, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [21, 22], +- loc: { +- start: { column: 21, line: 1 }, +- end: { column: 22, line: 1 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [12, 22], + loc: { + start: { column: 12, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + + range: [11, 23], + loc: { + start: { column: 11, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + + range: [0, 26], + loc: { + start: { column: 0, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..2968ea8bf5e --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,102 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter interface-in-const-modifier-multiple AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'interface', + + range: [0, 9], + loc: { + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'L', + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '<', + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'in', + + range: [12, 14], + loc: { + start: { column: 12, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Keyword { + type: 'Keyword', + value: 'const', + + range: [15, 20], + loc: { + start: { column: 15, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'T', + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '>', + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/fixture.ts new file mode 100644 index 00000000000..6d80230d43c --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/fixture.ts @@ -0,0 +1,5 @@ +class _ { + method() {} + method() {} + method() {} +} diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..3649928b2a0 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,328 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter method-const-modifiers TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "method", + + range: [12, 18], + loc: { + start: { column: 2, line: 2 }, + end: { column: 8, line: 2 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [30, 32], + loc: { + start: { column: 20, line: 2 }, + end: { column: 22, line: 2 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [25, 26], + loc: { + start: { column: 15, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + out: false, + + range: [19, 26], + loc: { + start: { column: 9, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + ], + + range: [18, 27], + loc: { + start: { column: 8, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + + range: [18, 32], + loc: { + start: { column: 8, line: 2 }, + end: { column: 22, line: 2 }, + }, + }, + + range: [12, 32], + loc: { + start: { column: 2, line: 2 }, + end: { column: 22, line: 2 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "method", + + range: [35, 41], + loc: { + start: { column: 2, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [63, 65], + loc: { + start: { column: 30, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + constraint: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [58, 59], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [58, 59], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [48, 49], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + out: false, + + range: [42, 59], + loc: { + start: { column: 9, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + + range: [41, 60], + loc: { + start: { column: 8, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [41, 65], + loc: { + start: { column: 8, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [35, 65], + loc: { + start: { column: 2, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "method", + + range: [68, 74], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + kind: "method", + override: false, + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [89, 91], + loc: { + start: { column: 23, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: false, + in: false, + name: Identifier { + type: "Identifier", + name: "T", + + range: [75, 76], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + out: false, + + range: [75, 76], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + TSTypeParameter { + type: "TSTypeParameter", + const: true, + in: false, + name: Identifier { + type: "Identifier", + name: "U", + + range: [84, 85], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + out: false, + + range: [78, 85], + loc: { + start: { column: 12, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + ], + + range: [74, 86], + loc: { + start: { column: 8, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [74, 91], + loc: { + start: { column: 8, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [68, 91], + loc: { + start: { column: 2, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + ], + + range: [8, 93], + loc: { + start: { column: 8, line: 1 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "_", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + superClass: null, + + range: [0, 93], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [0, 94], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..28ac5324b17 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,356 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter method-const-modifiers TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "_", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "method", + + range: [12, 18], + loc: { + start: { column: 2, line: 2 }, + end: { column: 8, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [18, 19], + loc: { + start: { column: 8, line: 2 }, + end: { column: 9, line: 2 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [19, 24], + loc: { + start: { column: 9, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [25, 26], + loc: { + start: { column: 15, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [26, 27], + loc: { + start: { column: 16, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [27, 28], + loc: { + start: { column: 17, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [28, 29], + loc: { + start: { column: 18, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [30, 31], + loc: { + start: { column: 20, line: 2 }, + end: { column: 21, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [31, 32], + loc: { + start: { column: 21, line: 2 }, + end: { column: 22, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "method", + + range: [35, 41], + loc: { + start: { column: 2, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [41, 42], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [42, 47], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [48, 49], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [50, 57], + loc: { + start: { column: 17, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [58, 59], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [59, 60], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [60, 61], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [61, 62], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [63, 64], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [64, 65], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "method", + + range: [68, 74], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [74, 75], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [75, 76], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [76, 77], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [78, 83], + loc: { + start: { column: 12, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [84, 85], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [85, 86], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [86, 87], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [87, 88], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [89, 90], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [90, 91], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [92, 93], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..33245a31fda --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/3-Babel-AST.shot @@ -0,0 +1,280 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter method-const-modifiers Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "method", + + range: [12, 18], + loc: { + start: { column: 2, line: 2 }, + end: { column: 8, line: 2 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [30, 32], + loc: { + start: { column: 20, line: 2 }, + end: { column: 22, line: 2 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + name: "T", + + range: [19, 26], + loc: { + start: { column: 9, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + ], + + range: [18, 27], + loc: { + start: { column: 8, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + + range: [27, 32], + loc: { + start: { column: 17, line: 2 }, + end: { column: 22, line: 2 }, + }, + }, + + range: [12, 32], + loc: { + start: { column: 2, line: 2 }, + end: { column: 22, line: 2 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "method", + + range: [35, 41], + loc: { + start: { column: 2, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [63, 65], + loc: { + start: { column: 30, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + const: true, + constraint: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "U", + + range: [58, 59], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [58, 59], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + name: "T", + + range: [42, 59], + loc: { + start: { column: 9, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + + range: [41, 60], + loc: { + start: { column: 8, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + + range: [60, 65], + loc: { + start: { column: 27, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [35, 65], + loc: { + start: { column: 2, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + MethodDefinition { + type: "MethodDefinition", + computed: false, + key: Identifier { + type: "Identifier", + name: "method", + + range: [68, 74], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + kind: "method", + static: false, + value: FunctionExpression { + type: "FunctionExpression", + async: false, + body: BlockStatement { + type: "BlockStatement", + body: Array [], + + range: [89, 91], + loc: { + start: { column: 23, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: "TSTypeParameterDeclaration", + params: Array [ + TSTypeParameter { + type: "TSTypeParameter", + name: "T", + + range: [75, 76], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + TSTypeParameter { + type: "TSTypeParameter", + const: true, + name: "U", + + range: [78, 85], + loc: { + start: { column: 12, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + ], + + range: [74, 86], + loc: { + start: { column: 8, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + + range: [86, 91], + loc: { + start: { column: 20, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [68, 91], + loc: { + start: { column: 2, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + ], + + range: [8, 93], + loc: { + start: { column: 8, line: 1 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "_", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + superClass: null, + + range: [0, 93], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: "script", + + range: [0, 94], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 6 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..f7df5dc117d --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,356 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter method-const-modifiers Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "_", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "method", + + range: [12, 18], + loc: { + start: { column: 2, line: 2 }, + end: { column: 8, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [18, 19], + loc: { + start: { column: 8, line: 2 }, + end: { column: 9, line: 2 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [19, 24], + loc: { + start: { column: 9, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [25, 26], + loc: { + start: { column: 15, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [26, 27], + loc: { + start: { column: 16, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [27, 28], + loc: { + start: { column: 17, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [28, 29], + loc: { + start: { column: 18, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [30, 31], + loc: { + start: { column: 20, line: 2 }, + end: { column: 21, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [31, 32], + loc: { + start: { column: 21, line: 2 }, + end: { column: 22, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "method", + + range: [35, 41], + loc: { + start: { column: 2, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [41, 42], + loc: { + start: { column: 8, line: 3 }, + end: { column: 9, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [42, 47], + loc: { + start: { column: 9, line: 3 }, + end: { column: 14, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [48, 49], + loc: { + start: { column: 15, line: 3 }, + end: { column: 16, line: 3 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [50, 57], + loc: { + start: { column: 17, line: 3 }, + end: { column: 24, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [58, 59], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [59, 60], + loc: { + start: { column: 26, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [60, 61], + loc: { + start: { column: 27, line: 3 }, + end: { column: 28, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [61, 62], + loc: { + start: { column: 28, line: 3 }, + end: { column: 29, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [63, 64], + loc: { + start: { column: 30, line: 3 }, + end: { column: 31, line: 3 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [64, 65], + loc: { + start: { column: 31, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + Identifier { + type: "Identifier", + value: "method", + + range: [68, 74], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "<", + + range: [74, 75], + loc: { + start: { column: 8, line: 4 }, + end: { column: 9, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "T", + + range: [75, 76], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [76, 77], + loc: { + start: { column: 10, line: 4 }, + end: { column: 11, line: 4 }, + }, + }, + Keyword { + type: "Keyword", + value: "const", + + range: [78, 83], + loc: { + start: { column: 12, line: 4 }, + end: { column: 17, line: 4 }, + }, + }, + Identifier { + type: "Identifier", + value: "U", + + range: [84, 85], + loc: { + start: { column: 18, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + + range: [85, 86], + loc: { + start: { column: 19, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [86, 87], + loc: { + start: { column: 20, line: 4 }, + end: { column: 21, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [87, 88], + loc: { + start: { column: 21, line: 4 }, + end: { column: 22, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [89, 90], + loc: { + start: { column: 23, line: 4 }, + end: { column: 24, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [90, 91], + loc: { + start: { column: 24, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [92, 93], + loc: { + start: { column: 0, line: 5 }, + end: { column: 1, line: 5 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..14bbb7928aa --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,342 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter method-const-modifiers AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'method', + + range: [12, 18], + loc: { + start: { column: 2, line: 2 }, + end: { column: 8, line: 2 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [30, 32], + loc: { + start: { column: 20, line: 2 }, + end: { column: 22, line: 2 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + const: true, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [25, 26], +- loc: { +- start: { column: 15, line: 2 }, +- end: { column: 16, line: 2 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [19, 26], + loc: { + start: { column: 9, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + ], + + range: [18, 27], + loc: { + start: { column: 8, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + +- range: [18, 32], ++ range: [27, 32], + loc: { +- start: { column: 8, line: 2 }, ++ start: { column: 17, line: 2 }, + end: { column: 22, line: 2 }, + }, + }, + + range: [12, 32], + loc: { + start: { column: 2, line: 2 }, + end: { column: 22, line: 2 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'method', + + range: [35, 41], + loc: { + start: { column: 2, line: 3 }, + end: { column: 8, line: 3 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [63, 65], + loc: { + start: { column: 30, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', + const: true, + constraint: TSTypeReference { + type: 'TSTypeReference', + typeName: Identifier { + type: 'Identifier', + name: 'U', + + range: [58, 59], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + + range: [58, 59], + loc: { + start: { column: 25, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [48, 49], +- loc: { +- start: { column: 15, line: 3 }, +- end: { column: 16, line: 3 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [42, 59], + loc: { + start: { column: 9, line: 3 }, + end: { column: 26, line: 3 }, + }, + }, + ], + + range: [41, 60], + loc: { + start: { column: 8, line: 3 }, + end: { column: 27, line: 3 }, + }, + }, + +- range: [41, 65], ++ range: [60, 65], + loc: { +- start: { column: 8, line: 3 }, ++ start: { column: 27, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + + range: [35, 65], + loc: { + start: { column: 2, line: 3 }, + end: { column: 32, line: 3 }, + }, + }, + MethodDefinition { + type: 'MethodDefinition', + computed: false, + key: Identifier { + type: 'Identifier', + name: 'method', + + range: [68, 74], + loc: { + start: { column: 2, line: 4 }, + end: { column: 8, line: 4 }, + }, + }, + kind: 'method', +- override: false, + static: false, + value: FunctionExpression { + type: 'FunctionExpression', + async: false, + body: BlockStatement { + type: 'BlockStatement', + body: Array [], + + range: [89, 91], + loc: { + start: { column: 23, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + expression: false, + generator: false, + id: null, + params: Array [], + typeParameters: TSTypeParameterDeclaration { + type: 'TSTypeParameterDeclaration', + params: Array [ + TSTypeParameter { + type: 'TSTypeParameter', +- const: false, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'T', +- +- range: [75, 76], +- loc: { +- start: { column: 9, line: 4 }, +- end: { column: 10, line: 4 }, +- }, +- }, +- out: false, ++ name: 'T', + + range: [75, 76], + loc: { + start: { column: 9, line: 4 }, + end: { column: 10, line: 4 }, + }, + }, + TSTypeParameter { + type: 'TSTypeParameter', + const: true, +- in: false, +- name: Identifier { +- type: 'Identifier', +- name: 'U', +- +- range: [84, 85], +- loc: { +- start: { column: 18, line: 4 }, +- end: { column: 19, line: 4 }, +- }, +- }, +- out: false, ++ name: 'U', + + range: [78, 85], + loc: { + start: { column: 12, line: 4 }, + end: { column: 19, line: 4 }, + }, + }, + ], + + range: [74, 86], + loc: { + start: { column: 8, line: 4 }, + end: { column: 20, line: 4 }, + }, + }, + +- range: [74, 91], ++ range: [86, 91], + loc: { +- start: { column: 8, line: 4 }, ++ start: { column: 20, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + + range: [68, 91], + loc: { + start: { column: 2, line: 4 }, + end: { column: 25, line: 4 }, + }, + }, + ], + + range: [8, 93], + loc: { + start: { column: 8, line: 1 }, + end: { column: 1, line: 5 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: '_', + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + superClass: null, + + range: [0, 93], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 5 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 94], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 6 }, + }, + }" +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..bceb93e84d3 --- /dev/null +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special TSTypeParameter method-const-modifiers AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/special/TSTypeParameter/spec.ts b/packages/ast-spec/src/special/TSTypeParameter/spec.ts index 7487e4f5617..1d0bc76f127 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/spec.ts +++ b/packages/ast-spec/src/special/TSTypeParameter/spec.ts @@ -10,4 +10,5 @@ export interface TSTypeParameter extends BaseNode { default?: TypeNode; in: boolean; out: boolean; + const: boolean; } diff --git a/packages/ast-spec/tests/fixtures-with-differences-ast.shot b/packages/ast-spec/tests/fixtures-with-differences-ast.shot index cfb895eda50..4b7b8657e76 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-ast.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-ast.shot @@ -235,5 +235,30 @@ Set { "legacy-fixtures/types/fixtures/tuple-optional/fixture.ts", "legacy-fixtures/types/fixtures/typeof-this/fixture.ts", "legacy-fixtures/types/fixtures/union-intersection/fixture.ts", + "special/TSTypeParameter/fixtures/arrow-const-modifier-extends/fixture.ts", + "special/TSTypeParameter/fixtures/arrow-const-modifier/fixture.ts", + "special/TSTypeParameter/fixtures/class-decl-const-in-modifier/fixture.ts", + "special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/fixture.ts", + "special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/fixture.ts", + "special/TSTypeParameter/fixtures/class-decl-const-modifier/fixture.ts", + "special/TSTypeParameter/fixtures/class-decl-in-const-modifier/fixture.ts", + "special/TSTypeParameter/fixtures/class-expr-const-in-modifier/fixture.ts", + "special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/fixture.ts", + "special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/fixture.ts", + "special/TSTypeParameter/fixtures/class-expr-const-modifier/fixture.ts", + "special/TSTypeParameter/fixtures/class-expr-in-const-modifier/fixture.ts", + "special/TSTypeParameter/fixtures/declare-func-const-modifier/fixture.ts", + "special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/fixture.ts", + "special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/fixture.ts", + "special/TSTypeParameter/fixtures/func-decl-const-modifier/fixture.ts", + "special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/fixture.ts", + "special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/fixture.ts", + "special/TSTypeParameter/fixtures/func-expr-const-modifier/fixture.ts", + "special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/fixture.ts", + "special/TSTypeParameter/fixtures/interface-const-modifier-extends/fixture.ts", + "special/TSTypeParameter/fixtures/interface-const-modifier-multiple/fixture.ts", + "special/TSTypeParameter/fixtures/interface-const-modifier/fixture.ts", + "special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/fixture.ts", + "special/TSTypeParameter/fixtures/method-const-modifiers/fixture.ts", } `; diff --git a/packages/ast-spec/tests/fixtures-with-differences-tokens.shot b/packages/ast-spec/tests/fixtures-with-differences-tokens.shot index 78042128e16..7a512bf413c 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-tokens.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-tokens.shot @@ -124,5 +124,10 @@ Set { "legacy-fixtures/types/fixtures/typeof-with-type-parameters/fixture.ts", "legacy-fixtures/types/fixtures/typeof/fixture.ts", "legacy-fixtures/types/fixtures/union-intersection/fixture.ts", + "special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/fixture.ts", + "special/TSTypeParameter/fixtures/interface-const-modifier-extends/fixture.ts", + "special/TSTypeParameter/fixtures/interface-const-modifier-multiple/fixture.ts", + "special/TSTypeParameter/fixtures/interface-const-modifier/fixture.ts", + "special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/fixture.ts", } `; diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 4d07c341bb2..e9c3e39d7a9 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -2407,6 +2407,7 @@ export class Converter { default: node.default ? this.convertType(node.default) : undefined, in: hasModifier(SyntaxKind.InKeyword, node), out: hasModifier(SyntaxKind.OutKeyword, node), + const: hasModifier(SyntaxKind.ConstKeyword, node), }); }