diff --git a/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap index 0ea5f89cdcd..2e49891dd14 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap @@ -475,6 +475,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 11, @@ -503,6 +504,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 10, 11, diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap index 03f030ad731..0a870b70441 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap @@ -2730,6 +2730,14 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/object-literal-type-with-accessors.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/optional-variance-in.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/optional-variance-in-and-out.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/optional-variance-in-out.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/optional-variance-out.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/parenthesized-type.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/types/reference.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/snapshots/typescript/babylon-convergence/type-parameter-whitespace-loc.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/babylon-convergence/type-parameter-whitespace-loc.src.ts.shot index 84a0faaccca..dc6ca7e1234 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/babylon-convergence/type-parameter-whitespace-loc.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/babylon-convergence/type-parameter-whitespace-loc.src.ts.shot @@ -74,6 +74,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 14, @@ -102,6 +103,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 13, 14, diff --git a/packages/typescript-estree/tests/snapshots/typescript/babylon-convergence/type-parameters.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/babylon-convergence/type-parameters.src.ts.shot index 245b52dc08a..994e697662a 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/babylon-convergence/type-parameters.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/babylon-convergence/type-parameters.src.ts.shot @@ -106,6 +106,7 @@ Object { ], "type": "TSObjectKeyword", }, + "in": undefined, "loc": Object { "end": Object { "column": 36, @@ -134,6 +135,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 11, 36, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/arrow-function-with-type-parameters.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/arrow-function-with-type-parameters.src.ts.shot index 126d82a3115..5bba4bae24c 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/arrow-function-with-type-parameters.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/arrow-function-with-type-parameters.src.ts.shot @@ -219,6 +219,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 2, @@ -247,6 +248,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 1, 2, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/call-signatures-with-generics.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/call-signatures-with-generics.src.ts.shot index 84bc3e241e6..c38ec847ea5 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/call-signatures-with-generics.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/call-signatures-with-generics.src.ts.shot @@ -168,6 +168,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 4, @@ -196,6 +197,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 16, 17, @@ -329,6 +331,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 7, @@ -357,6 +360,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 44, 45, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-constructor-and-type-parameters.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-constructor-and-type-parameters.src.ts.shot index 56353693fd6..d950727bee7 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-constructor-and-type-parameters.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-constructor-and-type-parameters.src.ts.shot @@ -98,6 +98,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 15, @@ -126,6 +127,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 24, 25, @@ -234,6 +236,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 19, @@ -262,6 +265,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 52, 53, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-extends-generic-multiple.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-extends-generic-multiple.src.ts.shot index bc3a09258d0..0a921e487de 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-extends-generic-multiple.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-extends-generic-multiple.src.ts.shot @@ -214,6 +214,7 @@ Object { "typeParameters": undefined, }, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 21, @@ -242,6 +243,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 10, 21, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-extends-generic.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-extends-generic.src.ts.shot index fac39361497..b83ffe8c56f 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-extends-generic.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-extends-generic.src.ts.shot @@ -143,6 +143,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 11, @@ -171,6 +172,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 10, 11, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-generic-method-default.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-generic-method-default.src.ts.shot index 517d5dd3e62..71bc3c5cc2c 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-generic-method-default.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-generic-method-default.src.ts.shot @@ -133,6 +133,7 @@ Object { }, "typeParameters": undefined, }, + "in": undefined, "loc": Object { "end": Object { "column": 16, @@ -161,6 +162,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 21, 28, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-generic-method.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-generic-method.src.ts.shot index 504612e7858..8f8586b9ec0 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-generic-method.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-generic-method.src.ts.shot @@ -98,6 +98,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 10, @@ -126,6 +127,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 21, 22, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-method.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-method.src.ts.shot index 84f1c8825bc..a5a68597b19 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-method.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-method.src.ts.shot @@ -211,6 +211,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 7, @@ -239,6 +240,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 36, 37, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-mixin-reference.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-mixin-reference.src.ts.shot index e9b4d70e837..9b18d787286 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-mixin-reference.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-mixin-reference.src.ts.shot @@ -235,6 +235,7 @@ Object { }, }, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 35, @@ -263,6 +264,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 11, 35, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-mixin.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-mixin.src.ts.shot index 7ea53067001..5565b47545c 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-mixin.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-mixin.src.ts.shot @@ -289,6 +289,7 @@ Object { }, }, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 36, @@ -317,6 +318,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 11, 36, @@ -828,6 +830,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 18, @@ -856,6 +859,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 175, 176, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-two-methods-computed-constructor.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-two-methods-computed-constructor.src.ts.shot index abf1f5816b2..0dec61e1da2 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-two-methods-computed-constructor.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-two-methods-computed-constructor.src.ts.shot @@ -133,6 +133,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 17, @@ -161,6 +162,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 26, 27, @@ -303,6 +305,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 19, @@ -331,6 +334,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 64, 65, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-type-parameter-default.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-type-parameter-default.src.ts.shot index 7f1f690528f..efee1d0a9e3 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-type-parameter-default.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-type-parameter-default.src.ts.shot @@ -106,6 +106,7 @@ Object { }, "typeParameters": undefined, }, + "in": undefined, "loc": Object { "end": Object { "column": 17, @@ -134,6 +135,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 10, 17, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-type-parameter-underscore.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-type-parameter-underscore.src.ts.shot index d069b3552b3..80627e04864 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-type-parameter-underscore.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-type-parameter-underscore.src.ts.shot @@ -71,6 +71,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 11, @@ -99,6 +100,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 8, 11, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-type-parameter.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-type-parameter.src.ts.shot index 3e52dcb8d33..f1ebe39ce0f 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-type-parameter.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-type-parameter.src.ts.shot @@ -71,6 +71,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 11, @@ -99,6 +100,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 10, 11, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/export-default-class-with-generic.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/export-default-class-with-generic.src.ts.shot index b2054c9f8be..e0633373502 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/export-default-class-with-generic.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/export-default-class-with-generic.src.ts.shot @@ -55,6 +55,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 22, @@ -83,6 +84,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 21, 22, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/export-default-class-with-multiple-generics.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/export-default-class-with-multiple-generics.src.ts.shot index ad9d453a491..a951ffdc0dd 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/export-default-class-with-multiple-generics.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/export-default-class-with-multiple-generics.src.ts.shot @@ -55,6 +55,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 22, @@ -83,6 +84,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 21, 22, @@ -92,6 +94,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 25, @@ -120,6 +123,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 24, 25, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/export-named-class-with-generic.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/export-named-class-with-generic.src.ts.shot index 4a648475383..e5688547eba 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/export-named-class-with-generic.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/export-named-class-with-generic.src.ts.shot @@ -73,6 +73,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 18, @@ -101,6 +102,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 17, 18, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/export-named-class-with-multiple-generics.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/export-named-class-with-multiple-generics.src.ts.shot index 988daf8a174..e34f544ce7e 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/export-named-class-with-multiple-generics.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/export-named-class-with-multiple-generics.src.ts.shot @@ -73,6 +73,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 18, @@ -101,6 +102,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 17, 18, @@ -110,6 +112,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 21, @@ -138,6 +141,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 20, 21, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/function-anonymus-with-type-parameters.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/function-anonymus-with-type-parameters.src.ts.shot index 018d4d72552..f8de0db1e9f 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/function-anonymus-with-type-parameters.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/function-anonymus-with-type-parameters.src.ts.shot @@ -167,6 +167,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 21, @@ -195,6 +196,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 20, 21, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/function-with-type-parameters-that-have-comments.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/function-with-type-parameters-that-have-comments.src.ts.shot index b626f8aa803..75253f966f9 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/function-with-type-parameters-that-have-comments.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/function-with-type-parameters-that-have-comments.src.ts.shot @@ -74,6 +74,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 29, @@ -102,6 +103,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 28, 29, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/function-with-type-parameters-with-constraint.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/function-with-type-parameters-with-constraint.src.ts.shot index a3ae99a1377..b1f923ef3c7 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/function-with-type-parameters-with-constraint.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/function-with-type-parameters-with-constraint.src.ts.shot @@ -252,6 +252,7 @@ Object { "type": "TSTypeLiteral", }, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 23, @@ -280,6 +281,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 11, 23, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/function-with-type-parameters.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/function-with-type-parameters.src.ts.shot index d65c9203b65..b329b415b79 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/function-with-type-parameters.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/function-with-type-parameters.src.ts.shot @@ -235,6 +235,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 12, @@ -263,6 +264,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 11, 12, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/interface-type-parameters.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/interface-type-parameters.src.ts.shot index 382d69ac3d4..7d315795fc4 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/interface-type-parameters.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/interface-type-parameters.src.ts.shot @@ -70,6 +70,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 15, @@ -98,6 +99,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 14, 15, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/interface-with-all-property-types.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/interface-with-all-property-types.src.ts.shot index dece748c4b2..aad32e7f8a4 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/interface-with-all-property-types.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/interface-with-all-property-types.src.ts.shot @@ -880,6 +880,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 9, @@ -908,6 +909,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 194, 195, @@ -1116,6 +1118,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 10, @@ -1144,6 +1147,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 247, 248, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/interface-with-extends-type-parameters.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/interface-with-extends-type-parameters.src.ts.shot index 4cb2e5a2a08..252a1b63455 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/interface-with-extends-type-parameters.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/interface-with-extends-type-parameters.src.ts.shot @@ -162,6 +162,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 15, @@ -190,6 +191,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 14, 15, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/interface-with-generic.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/interface-with-generic.src.ts.shot index 1ee99f876aa..f108ef8b06b 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/interface-with-generic.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/interface-with-generic.src.ts.shot @@ -70,6 +70,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 16, @@ -98,6 +99,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 15, 16, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/interface-with-method.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/interface-with-method.src.ts.shot index f94e3498298..a807fcb32c3 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/interface-with-method.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/interface-with-method.src.ts.shot @@ -308,6 +308,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 5, @@ -336,6 +337,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 45, 46, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/intrinsic-keyword.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/intrinsic-keyword.src.ts.shot index 22d41df5f1a..2d6e7801b73 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/intrinsic-keyword.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/intrinsic-keyword.src.ts.shot @@ -85,6 +85,7 @@ Object { "type": "TSStringKeyword", }, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 31, @@ -113,6 +114,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 15, 31, @@ -209,6 +211,7 @@ Object { "type": "TSStringKeyword", }, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 31, @@ -237,6 +240,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 61, 77, @@ -333,6 +337,7 @@ Object { "type": "TSStringKeyword", }, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 32, @@ -361,6 +366,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 108, 124, @@ -457,6 +463,7 @@ Object { "type": "TSStringKeyword", }, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 34, @@ -485,6 +492,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 157, 173, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/object-with-typed-methods.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/object-with-typed-methods.src.ts.shot index 33dc823fd72..10199d3091e 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/object-with-typed-methods.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/object-with-typed-methods.src.ts.shot @@ -200,6 +200,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 17, @@ -228,6 +229,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 30, 31, @@ -406,6 +408,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 7, @@ -434,6 +437,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 69, 70, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/type-alias-declaration-with-constrained-type-parameter.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/type-alias-declaration-with-constrained-type-parameter.src.ts.shot index 709a4cc36a6..ca2acdf23fe 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/type-alias-declaration-with-constrained-type-parameter.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/type-alias-declaration-with-constrained-type-parameter.src.ts.shot @@ -214,6 +214,7 @@ Object { "type": "TSTypeLiteral", }, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 24, @@ -242,6 +243,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 12, 24, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/type-alias-declaration.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/type-alias-declaration.src.ts.shot index b97bf6d4afd..8898fc5821c 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/type-alias-declaration.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/type-alias-declaration.src.ts.shot @@ -197,6 +197,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 13, @@ -225,6 +226,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 12, 13, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/type-parameters-comments-heritage.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/type-parameters-comments-heritage.src.ts.shot index d244e9e147f..37ee387eefd 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/type-parameters-comments-heritage.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/type-parameters-comments-heritage.src.ts.shot @@ -143,6 +143,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 23, @@ -171,6 +172,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 22, 23, @@ -360,6 +362,7 @@ Object { ], "type": "TSLiteralType", }, + "in": undefined, "loc": Object { "end": Object { "column": 38, @@ -388,6 +391,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 98, 113, @@ -561,6 +565,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 27, @@ -589,6 +594,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 191, 192, @@ -797,6 +803,7 @@ Object { ], "type": "TSLiteralType", }, + "in": undefined, "loc": Object { "end": Object { "column": 42, @@ -825,6 +832,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 272, 287, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/type-parameters-comments.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/type-parameters-comments.src.ts.shot index e4dc865f2b6..161fee1f76a 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/type-parameters-comments.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/type-parameters-comments.src.ts.shot @@ -183,6 +183,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 25, @@ -211,6 +212,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 68, 69, @@ -331,6 +333,7 @@ Object { }, "typeParameters": undefined, }, + "in": undefined, "loc": Object { "end": Object { "column": 41, @@ -359,6 +362,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 112, 129, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/typed-method-signature.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/typed-method-signature.src.ts.shot index a175d632669..11e74a7bb26 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/typed-method-signature.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/typed-method-signature.src.ts.shot @@ -351,6 +351,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 5, @@ -379,6 +380,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 41, 42, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer-nested.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer-nested.src.ts.shot index 50f8f0f7ff8..af335c7ea2c 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer-nested.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer-nested.src.ts.shot @@ -94,6 +94,7 @@ Object { "typeParameter": Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 20, @@ -122,6 +123,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 38, 39, @@ -201,6 +203,7 @@ Object { "typeParameter": Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 21, @@ -229,6 +232,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 69, 70, @@ -338,6 +342,7 @@ Object { "typeParameter": Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 31, @@ -366,6 +371,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 107, 108, @@ -588,6 +594,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 15, @@ -616,6 +623,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 14, 15, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer-simple.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer-simple.src.ts.shot index c172c25e40a..8b13cd578b9 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer-simple.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer-simple.src.ts.shot @@ -161,6 +161,7 @@ Object { "typeParameter": Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 36, @@ -189,6 +190,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 35, 36, @@ -273,6 +275,7 @@ Object { "typeParameter": Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 48, @@ -301,6 +304,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 47, 48, @@ -401,6 +405,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 10, @@ -429,6 +434,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 9, 10, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer.src.ts.shot index d55b6ac728e..d3e4a4e9464 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer.src.ts.shot @@ -94,6 +94,7 @@ Object { "typeParameter": Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 36, @@ -122,6 +123,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 35, 36, @@ -248,6 +250,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 14, @@ -276,6 +279,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 13, 14, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/constructor-generic.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/constructor-generic.src.ts.shot index d0434a7edb7..4a28bfbaf9d 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/constructor-generic.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/constructor-generic.src.ts.shot @@ -197,6 +197,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 13, @@ -225,6 +226,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 12, 13, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/function-generic.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/function-generic.src.ts.shot index 20329d59abb..83075915e1b 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/function-generic.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/function-generic.src.ts.shot @@ -196,6 +196,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 9, @@ -224,6 +225,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 8, 9, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/intersection-type.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/intersection-type.src.ts.shot index de61acf25c4..907a0c38e27 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/intersection-type.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/intersection-type.src.ts.shot @@ -274,6 +274,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 17, @@ -302,6 +303,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 16, 17, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/mapped-named-type.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/mapped-named-type.src.ts.shot index 4adec74e80a..ae8a3d6ce0a 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/mapped-named-type.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/mapped-named-type.src.ts.shot @@ -234,6 +234,7 @@ Object { }, }, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 15, @@ -262,6 +263,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 20, 32, @@ -284,6 +286,7 @@ Object { Object { "constraint": undefined, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 11, @@ -312,6 +315,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 10, 11, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/mapped-readonly-minus.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/mapped-readonly-minus.src.ts.shot index 5bc1ed74e22..9ba1c8e6249 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/mapped-readonly-minus.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/mapped-readonly-minus.src.ts.shot @@ -94,6 +94,7 @@ Object { "type": "TSStringKeyword", }, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 33, @@ -122,6 +123,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 22, 33, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/mapped-readonly-plus.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/mapped-readonly-plus.src.ts.shot index 0529961e665..9937dae14c2 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/mapped-readonly-plus.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/mapped-readonly-plus.src.ts.shot @@ -94,6 +94,7 @@ Object { "type": "TSStringKeyword", }, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 33, @@ -122,6 +123,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 22, 33, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/mapped-readonly.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/mapped-readonly.src.ts.shot index b18350797d0..b1ea2d6f362 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/mapped-readonly.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/mapped-readonly.src.ts.shot @@ -94,6 +94,7 @@ Object { "type": "TSStringKeyword", }, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 32, @@ -122,6 +123,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 21, 32, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/mapped-untypped.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/mapped-untypped.src.ts.shot index d254c7d5933..f0453f8a169 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/mapped-untypped.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/mapped-untypped.src.ts.shot @@ -75,6 +75,7 @@ Object { "type": "TSStringKeyword", }, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 23, @@ -103,6 +104,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 12, 23, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/mapped.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/mapped.src.ts.shot index 75f22d34e02..f05ee2777bf 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/mapped.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/mapped.src.ts.shot @@ -92,6 +92,7 @@ Object { "type": "TSStringKeyword", }, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 23, @@ -120,6 +121,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 12, 23, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-in-and-out.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-in-and-out.src.ts.shot new file mode 100644 index 00000000000..56732c94489 --- /dev/null +++ b/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-in-and-out.src.ts.shot @@ -0,0 +1,626 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`typescript types optional-variance-in-and-out.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Mapper", + "range": Array [ + 5, + 11, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 39, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 28, + 32, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 32, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 31, + 32, + ], + "type": "Identifier", + }, + "typeParameters": undefined, + }, + }, + }, + ], + "range": Array [ + 27, + 38, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 38, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "name": "U", + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + }, + "typeParameters": undefined, + }, + }, + "type": "TSFunctionType", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "params": Array [ + Object { + "constraint": undefined, + "default": undefined, + "in": true, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + }, + "out": undefined, + "range": Array [ + 12, + 16, + ], + "type": "TSTypeParameter", + }, + Object { + "constraint": undefined, + "default": undefined, + "in": undefined, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "U", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "out": true, + "range": Array [ + 18, + 23, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 11, + 24, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 40, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 11, + ], + "type": "Identifier", + "value": "Mapper", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 14, + ], + "type": "Keyword", + "value": "in", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 16, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "range": Array [ + 16, + 17, + ], + "type": "Punctuator", + "value": ",", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 21, + ], + "type": "Identifier", + "value": "out", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + "value": "U", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 36, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + "value": "U", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-in-out.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-in-out.src.ts.shot new file mode 100644 index 00000000000..9639322188c --- /dev/null +++ b/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-in-out.src.ts.shot @@ -0,0 +1,551 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`typescript types optional-variance-in-out.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Processor", + "range": Array [ + 5, + 14, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 39, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 28, + 32, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 32, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 31, + 32, + ], + "type": "Identifier", + }, + "typeParameters": undefined, + }, + }, + }, + ], + "range": Array [ + 27, + 38, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 38, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + }, + "typeParameters": undefined, + }, + }, + "type": "TSFunctionType", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "params": Array [ + Object { + "constraint": undefined, + "default": undefined, + "in": true, + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + }, + "out": true, + "range": Array [ + 15, + 23, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 14, + 24, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 40, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 14, + ], + "type": "Identifier", + "value": "Processor", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 15, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "range": Array [ + 15, + 17, + ], + "type": "Keyword", + "value": "in", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 21, + ], + "type": "Identifier", + "value": "out", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "range": Array [ + 28, + 29, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 31, + "line": 1, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "range": Array [ + 34, + 36, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 1, + }, + "start": Object { + "column": 37, + "line": 1, + }, + }, + "range": Array [ + 37, + 38, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 39, + "line": 1, + }, + "start": Object { + "column": 38, + "line": 1, + }, + }, + "range": Array [ + 38, + 39, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-in.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-in.src.ts.shot new file mode 100644 index 00000000000..b600fac8a6b --- /dev/null +++ b/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-in.src.ts.shot @@ -0,0 +1,514 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`typescript types optional-variance-in.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Consumer", + "range": Array [ + 5, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 37, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "x", + "range": Array [ + 23, + 27, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 27, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + }, + "typeParameters": undefined, + }, + }, + }, + ], + "range": Array [ + 22, + 36, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 36, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 36, + ], + "type": "TSVoidKeyword", + }, + }, + "type": "TSFunctionType", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "params": Array [ + Object { + "constraint": undefined, + "default": undefined, + "in": true, + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + }, + "out": undefined, + "range": Array [ + 14, + 18, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 13, + 19, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 38, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 13, + ], + "type": "Identifier", + "value": "Consumer", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 16, + ], + "type": "Keyword", + "value": "in", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "range": Array [ + 17, + 18, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "start": Object { + "column": 20, + "line": 1, + }, + }, + "range": Array [ + 20, + 21, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "range": Array [ + 22, + 23, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "range": Array [ + 27, + 28, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 31, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "range": Array [ + 32, + 36, + ], + "type": "Keyword", + "value": "void", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "start": Object { + "column": 36, + "line": 1, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-out.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-out.src.ts.shot new file mode 100644 index 00000000000..01664fc8941 --- /dev/null +++ b/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-out.src.ts.shot @@ -0,0 +1,407 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`typescript types optional-variance-out.src 1`] = ` +Object { + "body": Array [ + Object { + "id": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "Provider", + "range": Array [ + 5, + 13, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 31, + ], + "type": "TSTypeAliasDeclaration", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "params": Array [], + "range": Array [ + 23, + 30, + ], + "returnType": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 30, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + }, + "typeParameters": undefined, + }, + }, + "type": "TSFunctionType", + }, + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "params": Array [ + Object { + "constraint": undefined, + "default": undefined, + "in": undefined, + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "name": Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "T", + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + }, + "out": true, + "range": Array [ + 14, + 19, + ], + "type": "TSTypeParameter", + }, + ], + "range": Array [ + 13, + 20, + ], + "type": "TSTypeParameterDeclaration", + }, + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 32, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 4, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 4, + ], + "type": "Identifier", + "value": "type", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 13, + ], + "type": "Identifier", + "value": "Provider", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 1, + }, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "range": Array [ + 14, + 17, + ], + "type": "Identifier", + "value": "out", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "range": Array [ + 18, + 19, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "range": Array [ + 19, + 20, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "range": Array [ + 21, + 22, + ], + "type": "Punctuator", + "value": "=", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "range": Array [ + 26, + 28, + ], + "type": "Punctuator", + "value": "=>", + }, + Object { + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "range": Array [ + 29, + 30, + ], + "type": "Identifier", + "value": "T", + }, + Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 30, + "line": 1, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/template-literal-type-4.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/template-literal-type-4.src.ts.shot index fafb3e04c2f..72e20af9b1c 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/template-literal-type-4.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/template-literal-type-4.src.ts.shot @@ -559,6 +559,7 @@ Object { "type": "TSStringKeyword", }, "default": undefined, + "in": undefined, "loc": Object { "end": Object { "column": 42, @@ -587,6 +588,7 @@ Object { ], "type": "Identifier", }, + "out": undefined, "range": Array [ 26, 42,