diff --git a/.prettierignore b/.prettierignore index 5e3434855df6..548792bb901b 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 13f2fe48ba0d..782be4b44b2f 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 0ee9dbba0359..8d97c664397e 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 aac248040d84..7e3c1cda98cf 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 f6d5a3c73b31..60e9b202a98e 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 24eae0d32901..bbdff121824a 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 98ace90820fb..b910a007d541 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 b2caab0f05b8..7ed214a6dac8 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 b997a40aca31..d54f1d9b3957 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 aefd6e905e23..7ebe6a511c98 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 5c07aedab59c..711d27f25cf4 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 4767a93811ca..f918dfb9f1ee 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 6763966b08fc..a683f16a8787 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 6aea3322462f..0dfd9b0dbedc 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 56e43bd66323..4b1dec3a2695 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 15f674485662..5a3ea46e5bb3 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 d6859d52b512..8470b26ba849 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 af8a41ed4787..9e30e10752b9 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 a80b5aa0a110..939521199a67 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 6bf2120e61b4..9bf1ca3a104c 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 d754f2bf397b..9ea3fc2ca74b 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 5e87232cc312..6f555db8cd09 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 546c2e3fa6b9..681409dd0ecb 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 7612bfb5dbd4..fb934bcd345f 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 6a4e1eb30bfd..2567fb6d1987 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 788e721214b1..64b437f49e8b 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 0886302dddea..7f4ad90fdb0d 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 9346217d8e18..f9c5d072f707 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 6a4db1dffed8..a60f0ce742c7 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 3859f9dbe851..ae4834c3b192 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 543de450f926..baf4e31b33b6 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 9251113d68d8..e365a073333b 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 ac8187f43683..ac7c601b7ec5 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 b39f7d0995d2..c358470ad229 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 72b1fa15c47e..e9e2c7244b24 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 4cb9045a5efb..f6697f97e72f 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 6ec0c4dc7794..d823b4570e5f 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 d86b4174035c..8106d34ab7be 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 fa3122911f78..8b3757898e92 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 ab072a5f07b5..35a8324a5c4a 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 24ee207bc651..f215d2b9478e 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 5a3bdce9ce18..7571b2dce2ee 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 8801f524ccc5..b113f663f51f 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 7bf59de03daa..edb09734f9b1 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 efd120448d33..83d183469759 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 11e13c3a1d9d..3ceea1ac9bbf 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 da8b2d5230bd..d4ed8c5b153b 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 f4a699b14144..fe39caba13d7 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 28d9a945fca1..8a7308c52fc9 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 26e794c23c8d..6b86bc109cb6 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 48fca727adc1..64dc9ab9f6f5 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 6f105eb8e620..f6f1e2e2b390 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 4ffda7290afb..77a16a4302d1 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 4a03c5671eb3..ab3fe7fc1cb6 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 c1c8ef302170..45815b0a9780 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 5f1bbd5e181f..5bf16695b422 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 dd2224404838..cafef05a22f2 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 7b536d258a7d..41b3777d672d 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 a35e030838b2..5f19d6e96e4e 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 6a8770bed94b..aafa8b03f6dc 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 99cb440a924b..c096db788aa2 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 e2c552e2e1fa..a6e6a40408c2 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 16c2ff77580b..76444e06f3c3 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 4ce1b21c01c2..deff03fd9562 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 d191fba20dc2..a47e9957bd9d 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 316e2a82e7f6..2b15bd765986 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 ce9b773200c6..d4403d29158a 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 2b42ff502a9c..c8453b6255c0 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 abf4bc974391..11ec84abe7fb 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 ec9ca83ec2cc..c7d0b884a3b8 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 54f1565f714d..c4fc663d9e21 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 d3e96136ef65..3bd4cc3552fd 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 bcc3599d4182..79507cbad056 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 a85e5d164fcb..5e8f5a67cedf 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 f6f48a1fa512..e6b93ecb73b6 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 709dafa02b58..c4f36c1cdaa0 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 69311fed2219..89bf1373ea09 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 e8f81ec7e884..c18166ff6dc9 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 6dce128496d8..134b63d05f42 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 795cf38b0f51..ce5a9d72e712 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 dc8fc8c015ac..e451c313454b 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 0a8917e84b8d..53b3c3a9fcdd 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 37f3b64b54e1..95d18c2f62ca 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 576e0c9b98a9..999d0c3a74de 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 d1bcce0c6fc3..37c6b8de68f8 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 15fde1c2edb9..39047e8fcef6 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 ff26a6e29d7e..724bdedf9c7e 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 a1143b8b44c6..c6167c1cfeb9 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 8d86878a9bce..71fe4bac95bb 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 9bffe5d67176..4275a3f7ebba 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 390ac4c254d3..72a35e38426f 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 a8b7cf3db2ff..71c4e1069ee5 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 a4c653aa539c..3e71f1e73e3d 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 f63f70371c8c..ea44724e949d 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 5ae5b0f49662..66f821f85af7 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 908466c31fdb..d37879b44ab6 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 285e659b66b6..bc029519defe 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 37e9d21a8b9e..025c5b453290 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 fb218b26aa37..1726ad50b2fb 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 a2a6283fff86..58a3cfb41839 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 a8213dcf5ab1..8fcec2c09052 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 de7addfe3963..52a61f42484a 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 4462a057b8ba..1a756edb61f7 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 6537caf714f5..d0a14fbce55b 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 a57f192e4a2f..fb4d069532a1 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 20121cf188ab..26157d798fe0 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 65aeb0689ca9..624a79fb35de 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 ad99fda9528e..5ceb049ff33c 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 3148bb5b7409..e6d132ed1619 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 d69be386629c..13dbfd5fd9d1 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 75e06a9b433f..cd82008e2c36 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 aedabb491bc6..9e69aba7257c 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 03f4bb194f82..11ad724238e3 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 95ee43a32552..98713d77e9b5 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 c46578e24d03..75db4f143539 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 f224655bb634..81d37b235ba4 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 0acb047d6756..d5831586688e 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 86e8cc26e85c..070d7a33c7b3 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 c8f77719ef7a..5b560fa04c44 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 101936bcbabf..3842372420df 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 20b933b3fd64..1c8d89c36809 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 192a30ecd8b5..a196f567eb84 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 ae55b74f2dc5..9afebcfe4301 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 1b9878d79b7a..f299934132b4 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 d6b807f6ded2..06e7cb02c0e6 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 000000000000..6449f9a9a324 --- /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 000000000000..4196b1ffe0e6 --- /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 000000000000..1121e5b9ac34 --- /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 000000000000..47e9fb0466a2 --- /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 000000000000..e353eb64634c --- /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 000000000000..a1609757d3c8 --- /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 000000000000..098a78ba535d --- /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 000000000000..e887ecf87886 --- /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 000000000000..766e190e49f5 --- /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 000000000000..6fd763d2a2da --- /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 000000000000..e5ea70f6a9e2 --- /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 000000000000..91a25dd7138a --- /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 000000000000..0fd5e92e286a --- /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 000000000000..30ea230053eb --- /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 000000000000..a6771c2cdb4f --- /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 000000000000..24e7c42ba0fb --- /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 000000000000..f2e380c19dd7 --- /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 000000000000..422530d039c5 --- /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 000000000000..6abbc6c549ed --- /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 000000000000..b8aa62a507ca --- /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 000000000000..28f1e6988ff3 --- /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 000000000000..ccc2587d9d04 --- /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 000000000000..a31ab33ed3ab --- /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 000000000000..cdea319464d4 --- /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 000000000000..f1530945fe05 --- /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 000000000000..3fd9f064797d --- /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 000000000000..6b9faf086d69 --- /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 000000000000..eeff4a273371 --- /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 000000000000..20dc9a333dad --- /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 000000000000..690ad079a693 --- /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 000000000000..b54ca39a613f --- /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 000000000000..f2a92ee1a317 --- /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 000000000000..2245d514cb77 --- /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 000000000000..274981ae1255 --- /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 000000000000..c5dac045eb05 --- /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 000000000000..41a67eea3260 --- /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 000000000000..52825106e0da --- /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 000000000000..ee3a6611f449 --- /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 000000000000..5220f23ce44d --- /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 000000000000..83faac7304ed --- /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 000000000000..27b0483a19b8 --- /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 000000000000..f520c9957e15 --- /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 000000000000..046c0ebea359 --- /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 000000000000..3cf992b08577 --- /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 000000000000..cc9e9adc2320 --- /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 000000000000..a1f230b755dc --- /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 000000000000..8c2ed4d12b76 --- /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 000000000000..f6ed4a29e37c --- /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 000000000000..00026112623a --- /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 000000000000..7a02fba43020 --- /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 000000000000..8d185f20e56e --- /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 000000000000..72be2d9bf955 --- /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 000000000000..8c6a13cf3853 --- /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 000000000000..e4633d22a4f2 --- /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 000000000000..d212dd9308fd --- /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 000000000000..fd592298c031 --- /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 000000000000..cd6ecc95bec3 --- /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 000000000000..6b0bdc7a2bfa --- /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 000000000000..6cc630de9e09 --- /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 000000000000..5fe5b59605ee --- /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 000000000000..6ac0b40cf560 --- /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 000000000000..3d17a9cdd495 --- /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 000000000000..958efeb49a12 --- /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 000000000000..a0fd2dc36d9e --- /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 000000000000..eea3aa66bb97 --- /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 000000000000..e01a5b533d12 --- /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 000000000000..7c778a6bcfc8 --- /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 000000000000..c14e30728092 --- /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 000000000000..b6d1dee5b192 --- /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 000000000000..64789f76ca48 --- /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 000000000000..e7c0e459e69f --- /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 000000000000..33256b778c3a --- /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 000000000000..3811f6f336dd --- /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 000000000000..dd822ac4a939 --- /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 000000000000..63d8766b2e13 --- /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 000000000000..2363475fdb49 --- /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 000000000000..e0ae36e4faad --- /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 000000000000..eb21599bf3b2 --- /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 000000000000..fcffd0b8c92f --- /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 000000000000..10da065d45e6 --- /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 000000000000..be63bfbe539f --- /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 000000000000..a9c914863e5d --- /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 000000000000..f3f3121a24c6 --- /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 000000000000..f56069113d35 --- /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 000000000000..64a3bb417559 --- /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 000000000000..08cb4c0d8ce2 --- /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 000000000000..fca049179424 --- /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 000000000000..56ce8e8fbb7b --- /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 000000000000..4e67a63ce2ea --- /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 000000000000..15e908f2a614 --- /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 000000000000..ae8d720d1e02 --- /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 000000000000..4890237a6c9c --- /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 000000000000..12df729c7215 --- /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 000000000000..1b7875fbe5f8 --- /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 000000000000..12e8654b2dff --- /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 000000000000..0ebba700612d --- /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 000000000000..737f0d3abc77 --- /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 000000000000..fa7630102222 --- /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 000000000000..210ce695b011 --- /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 000000000000..6068e9975005 --- /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 000000000000..c86b697b908a --- /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 000000000000..f6da4949e068 --- /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 000000000000..9771e4d1bed7 --- /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 000000000000..eba1adb09f47 --- /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 000000000000..f694d6108398 --- /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 000000000000..ed2db338e0de --- /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 000000000000..933e7b9dc03d --- /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 000000000000..da988d004a40 --- /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 000000000000..882e37dbb44a --- /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 000000000000..7fb17b6a7092 --- /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 000000000000..71ee0e188f1b --- /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 000000000000..08d9c0b92f10 --- /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 000000000000..956e8a53eb9d --- /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 000000000000..6c8b5394aa19 --- /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 000000000000..681e30413be9 --- /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 000000000000..7c6f2a7b1b6f --- /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 000000000000..98e9fe2a75d2 --- /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 000000000000..64cbd211b5da --- /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 000000000000..80c919e9a1ca --- /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 000000000000..7fa1dc543ca9 --- /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 000000000000..a6bf6f0d28d9 --- /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 000000000000..3bd2ede90547 --- /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 000000000000..99989558e4e3 --- /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 000000000000..17ba38de7131 --- /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 000000000000..2a50d483de22 --- /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 000000000000..e5a3f88961e2 --- /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 000000000000..a0f0b5dda215 --- /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 000000000000..877b212c5742 --- /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 000000000000..e27c4c4e7217 --- /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 000000000000..41db13981ed1 --- /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 000000000000..d5170f6f5c35 --- /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 000000000000..a5476c5645ad --- /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 000000000000..c3e5830fb8b5 --- /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 000000000000..14025fb6fd5b --- /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 000000000000..08244df83433 --- /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 000000000000..ec23b39aefb8 --- /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 000000000000..3ba533c5899d --- /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 000000000000..dd79b1ba3cdd --- /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 000000000000..4add40cf5d13 --- /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 000000000000..9c4fc733e263 --- /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 000000000000..039606144f17 --- /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 000000000000..25ee38077346 --- /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 000000000000..e484e1a896e3 --- /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 000000000000..e07e4c12960f --- /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 000000000000..83a3d9ecbc6d --- /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 000000000000..47c6ccd25b6e --- /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 000000000000..8ca3d093cdb3 --- /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 000000000000..6c8c019b3bd1 --- /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 000000000000..99e68cb460e5 --- /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 000000000000..ba0f13bfa7a0 --- /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 000000000000..4074fcf6f516 --- /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 000000000000..484ffd2241fe --- /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 000000000000..80b85b253f04 --- /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 000000000000..87b3bd7d4732 --- /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 000000000000..b39faab878aa --- /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 000000000000..c05151d32379 --- /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 000000000000..43d078d4e556 --- /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 000000000000..349b9c261c59 --- /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 000000000000..468d542ddc64 --- /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 000000000000..f24056fd5d6a --- /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 000000000000..7e76e0508261 --- /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 000000000000..8dc6e2f6033f --- /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 000000000000..67eee83add54 --- /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 000000000000..315b7d125879 --- /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 000000000000..8927bc9e6555 --- /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 000000000000..d44d5cef7622 --- /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 000000000000..3579f6bbe03b --- /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 000000000000..2968ea8bf5ea --- /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 000000000000..6d80230d43c8 --- /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 000000000000..3649928b2a0c --- /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 000000000000..28ac5324b17a --- /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 000000000000..33245a31fda7 --- /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 000000000000..f7df5dc117d0 --- /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 000000000000..14bbb7928aa3 --- /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 000000000000..bceb93e84d35 --- /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 7487e4f56177..1d0bc76f127d 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 cfb895eda509..4b7b8657e760 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 78042128e16c..7a512bf413c5 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 4d07c341bb2a..e9c3e39d7a92 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), }); }