From d9766932db539421e735c4ea28effdef2f0fcef8 Mon Sep 17 00:00:00 2001 From: James Kyle Date: Tue, 26 Sep 2017 05:42:33 +1000 Subject: [PATCH] Ensure no-overlap between Flow and TS node types (#710) --- src/plugins/typescript.js | 64 +++++++------ src/types.js | 91 ++++++++++++++----- .../arrow-function/annotated/expected.json | 6 +- .../expected.json | 4 +- .../async-generic/expected.json | 10 +- .../arrow-function/async/expected.json | 6 +- .../default-parameter-values/expected.json | 4 +- .../arrow-function/generic-tsx/expected.json | 10 +- .../arrow-function/generic/expected.json | 10 +- .../optional-parameter/expected.json | 6 +- .../predicate-types/expected.json | 8 +- .../class/constructor/expected.json | 14 +-- .../typescript/class/declare/expected.json | 10 +- .../expected.json | 10 +- .../class/expression-extends/expected.json | 6 +- .../class/expression-generic/expected.json | 10 +- .../class/expression-implements/expected.json | 6 +- .../class/extends-implements/expected.json | 6 +- .../typescript/class/extends/expected.json | 4 +- .../typescript/class/generic/expected.json | 8 +- .../class/get-generic/expected.json | 8 +- .../typescript/class/implements/expected.json | 4 +- .../class/index-signature/expected.json | 10 +- .../members-with-modifier-names/expected.json | 12 +-- .../members-with-reserved-names/expected.json | 4 +- .../class/method-computed/expected.json | 6 +- .../class/method-generic/expected.json | 20 ++-- .../class/method-no-body/expected.json | 4 +- .../class/method-optional/expected.json | 4 +- .../class/method-return-type/expected.json | 4 +- .../class/modifiers-properties/expected.json | 4 +- .../expected.json | 4 +- .../class/parameter-properties/expected.json | 8 +- .../typescript/class/properties/expected.json | 6 +- .../class/property-computed/expected.json | 6 +- .../const/no-initializer/expected.json | 4 +- .../typescript/declare/const/expected.json | 6 +- .../declare/destructure/expected.json | 8 +- .../typescript/declare/var/expected.json | 4 +- .../typescript/export/declare/expected.json | 6 +- .../function/annotated/expected.json | 10 +- .../function/anonymous/expected.json | 10 +- .../typescript/function/declare/expected.json | 10 +- .../function/export-default/expected.json | 6 +- .../function/overloads/expected.json | 10 +- .../function/predicate-types/expected.json | 14 +-- .../interface/call-signature/expected.json | 6 +- .../construct-signature/expected.json | 6 +- .../interface/extends/expected.json | 4 +- .../interface/generic/expected.json | 8 +- .../interface/index-signature/expected.json | 6 +- .../interface/method-computed/expected.json | 6 +- .../interface/method-generic/expected.json | 10 +- .../interface/method-optional/expected.json | 4 +- .../interface/method-plain/expected.json | 8 +- .../interface/modifiers/expected.json | 4 +- .../interface/properties/expected.json | 6 +- .../interface/property-computed/expected.json | 6 +- .../property-named-public/expected.json | 4 +- .../reserved-method-name/expected.json | 4 +- .../interface/separators/expected.json | 14 +-- .../body-declare/expected.json | 4 +- .../body-nested-declare/expected.json | 4 +- .../global-in-module/expected.json | 4 +- .../tsx/brace-is-block/expected.json | 4 +- .../type-alias/generic-complex/expected.json | 10 +- .../type-alias/generic/expected.json | 6 +- .../type-arguments/call/expected.json | 6 +- .../type-arguments/new/expected.json | 6 +- .../type-arguments/whitespace/expected.json | 6 +- .../typescript/types/array/expected.json | 4 +- .../types/function-generic/expected.json | 12 +-- .../types/function-in-generic/expected.json | 8 +- .../types/function-with-this/expected.json | 8 +- .../typescript/types/function/expected.json | 12 +-- .../typescript/types/indexed/expected.json | 4 +- .../typescript/types/keywords/expected.json | 22 ++--- .../types/literal-boolean/expected.json | 6 +- .../literal-number-negative/expected.json | 4 +- .../types/literal-number/expected.json | 4 +- .../types/literal-string/expected.json | 4 +- .../typescript/types/mapped/expected.json | 10 +- .../reference-generic-nested/expected.json | 8 +- .../types/reference-generic/expected.json | 6 +- .../typescript/types/reference/expected.json | 4 +- .../types/type-literal/expected.json | 6 +- .../types/type-operator/expected.json | 4 +- .../typescript/types/typeof/expected.json | 4 +- .../types/union-intersection/expected.json | 10 +- 89 files changed, 410 insertions(+), 361 deletions(-) diff --git a/src/plugins/typescript.js b/src/plugins/typescript.js index b4e60e5ed8..b2601dfd43 100644 --- a/src/plugins/typescript.js +++ b/src/plugins/typescript.js @@ -256,8 +256,8 @@ export default (superClass: Class): Class => return this.finishNode(node, "TSTypeQuery"); } - tsParseTypeParameter(): N.TypeParameter { - const node: N.TypeParameter = this.startNode(); + tsParseTypeParameter(): N.TsTypeParameter { + const node: N.TsTypeParameter = this.startNode(); node.name = this.parseIdentifierName(node.start); if (this.eat(tt._extends)) { node.constraint = this.tsParseType(); @@ -267,17 +267,17 @@ export default (superClass: Class): Class => node.default = this.tsParseType(); } - return this.finishNode(node, "TypeParameter"); + return this.finishNode(node, "TSTypeParameter"); } - tsTryParseTypeParameters(): ?N.TypeParameterDeclaration { + tsTryParseTypeParameters(): ?N.TsTypeParameterDeclaration { if (this.isRelational("<")) { return this.tsParseTypeParameters(); } } tsParseTypeParameters() { - const node: N.TypeParameterDeclaration = this.startNode(); + const node: N.TsTypeParameterDeclaration = this.startNode(); if (this.isRelational("<") || this.match(tt.jsxTagStart)) { this.next(); @@ -291,7 +291,7 @@ export default (superClass: Class): Class => /* bracket */ false, /* skipFirstToken */ true, ); - return this.finishNode(node, "TypeParameterDeclaration"); + return this.finishNode(node, "TSTypeParameterDeclaration"); } // Note: In TypeScript implementation we must provide `yieldContext` and `awaitContext`, @@ -460,12 +460,12 @@ export default (superClass: Class): Class => return this.match(tt._in); } - tsParseMappedTypeParameter(): N.TypeParameter { - const node: N.TypeParameter = this.startNode(); + tsParseMappedTypeParameter(): N.TsTypeParameter { + const node: N.TsTypeParameter = this.startNode(); node.name = this.parseIdentifierName(node.start); this.expect(tt._in); node.constraint = this.tsParseType(); - return this.finishNode(node, "TypeParameter"); + return this.finishNode(node, "TSTypeParameter"); } tsParseMappedType(): N.TsMappedType { @@ -719,8 +719,8 @@ export default (superClass: Class): Class => tsParseTypeOrTypePredicateAnnotation( returnToken: TokenType, - ): N.TypeAnnotation { - const t: N.TypeAnnotation = this.startNode(); + ): N.TsTypeAnnotation { + const t: N.TsTypeAnnotation = this.startNode(); this.expect(returnToken); const typePredicateVariable = @@ -739,16 +739,16 @@ export default (superClass: Class): Class => node.parameterName = typePredicateVariable; node.typeAnnotation = type; t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); - return this.finishNode(t, "TypeAnnotation"); + return this.finishNode(t, "TSTypeAnnotation"); } - tsTryParseTypeOrTypePredicateAnnotation(): ?N.TypeAnnotation { + tsTryParseTypeOrTypePredicateAnnotation(): ?N.TsTypeAnnotation { return this.match(tt.colon) ? this.tsParseTypeOrTypePredicateAnnotation(tt.colon) : undefined; } - tsTryParseTypeAnnotation(): ?N.TypeAnnotation { + tsTryParseTypeAnnotation(): ?N.TsTypeAnnotation { return this.match(tt.colon) ? this.tsParseTypeAnnotation() : undefined; } @@ -766,11 +766,11 @@ export default (superClass: Class): Class => tsParseTypeAnnotation( eatColon = true, - t: N.TypeAnnotation = this.startNode(), - ): N.TypeAnnotation { + t: N.TsTypeAnnotation = this.startNode(), + ): N.TsTypeAnnotation { if (eatColon) this.expect(tt.colon); t.typeAnnotation = this.tsParseType(); - return this.finishNode(t, "TypeAnnotation"); + return this.finishNode(t, "TSTypeAnnotation"); } tsParseType(): N.TsType { @@ -799,9 +799,9 @@ export default (superClass: Class): Class => return this.finishNode(node, "TSTypeAssertion"); } - tsTryParseTypeArgumentsInExpression(): ?N.TypeParameterInstantiation { + tsTryParseTypeArgumentsInExpression(): ?N.TsTypeParameterInstantiation { return this.tsTryParseAndCatch(() => { - const res: N.TypeParameterInstantiation = this.startNode(); + const res: N.TsTypeParameterInstantiation = this.startNode(); this.expectRelational("<"); const typeArguments = this.tsParseDelimitedList( "TypeParametersOrArguments", @@ -809,7 +809,7 @@ export default (superClass: Class): Class => ); this.expectRelational(">"); res.params = typeArguments; - this.finishNode(res, "TypeParameterInstantiation"); + this.finishNode(res, "TSTypeParameterInstantiation"); this.expect(tt.parenL); return res; }); @@ -1180,7 +1180,7 @@ export default (superClass: Class): Class => return this.finishNode(res, "ArrowFunctionExpression"); } - tsParseTypeArguments(): N.TypeParameterInstantiation { + tsParseTypeArguments(): N.TsTypeParameterInstantiation { const node = this.startNode(); this.expectRelational("<"); node.params = this.tsParseDelimitedList( @@ -1188,7 +1188,7 @@ export default (superClass: Class): Class => this.tsParseType.bind(this), ); this.expectRelational(">"); - return this.finishNode(node, "TypeParameterInstantiation"); + return this.finishNode(node, "TSTypeParameterInstantiation"); } // ====================================================== @@ -1587,14 +1587,14 @@ export default (superClass: Class): Class => } if (this.match(tt.colon)) { - const typeCastNode: N.TypeCastExpression = this.startNodeAt( + const typeCastNode: N.TsTypeCastExpression = this.startNodeAt( startPos, startLoc, ); typeCastNode.expression = node; typeCastNode.typeAnnotation = this.tsParseTypeAnnotation(); - return this.finishNode(typeCastNode, "TypeCastExpression"); + return this.finishNode(typeCastNode, "TSTypeCastExpression"); } return node; @@ -1751,7 +1751,7 @@ export default (superClass: Class): Class => // Either way, we're looking at a '<': tt.jsxTagStart or relational. let arrowExpression; - let typeParameters: N.TypeParameterDeclaration; + let typeParameters: N.TsTypeParameterDeclaration; const state = this.state.clone(); try { // This is similar to TypeScript's `tryParseParenthesizedArrowFunctionExpression`. @@ -1849,7 +1849,7 @@ export default (superClass: Class): Class => contextDescription: string, ): N.Node { switch (node.type) { - case "TypeCastExpression": + case "TSTypeCastExpression": return super.toAssignable( this.typeCastToParameter(node), isBinding, @@ -1869,7 +1869,7 @@ export default (superClass: Class): Class => contextDescription: string, ): void { switch (expr.type) { - case "TypeCastExpression": + case "TSTypeCastExpression": // Allow "typecasts" to appear on the left of assignment expressions, // because it may be in an arrow function. // e.g. `const f = (foo: number = 0) => foo;` @@ -1945,14 +1945,14 @@ export default (superClass: Class): Class => ): $ReadOnlyArray { for (let i = 0; i < exprList.length; i++) { const expr = exprList[i]; - if (expr && expr.type === "TypeCastExpression") { + if (expr && expr.type === "TSTypeCastExpression") { exprList[i] = this.typeCastToParameter(expr); } } return super.toAssignableList(exprList, isBinding, contextDescription); } - typeCastToParameter(node: N.TypeCastExpression): N.Node { + typeCastToParameter(node: N.TsTypeCastExpression): N.Node { node.expression.typeAnnotation = node.typeAnnotation; return this.finishNodeAt( @@ -1968,7 +1968,11 @@ export default (superClass: Class): Class => ): $ReadOnlyArray { for (let i = 0; i < exprList.length; i++) { const expr = exprList[i]; - if (expr && expr._exprListItem && expr.type === "TypeCastExpression") { + if ( + expr && + expr._exprListItem && + expr.type === "TsTypeCastExpression" + ) { this.raise(expr.start, "Did not expect a type annotation here."); } } diff --git a/src/types.js b/src/types.js index dd9fe07563..846d74b451 100644 --- a/src/types.js +++ b/src/types.js @@ -157,8 +157,8 @@ export type BodilessFunctionOrMethodBase = HasDecorators & { // TODO: All not in spec expression: boolean, - typeParameters?: ?TypeParameterDeclaration, - returnType?: ?TypeAnnotation, + typeParameters?: ?TypeParameterDeclarationBase, + returnType?: ?TypeAnnotationBase, }; export type BodilessFunctionBase = BodilessFunctionOrMethodBase & { @@ -524,7 +524,7 @@ export type ConditionalExpression = NodeBase & { export type CallOrNewBase = NodeBase & { callee: Expression | Super | Import, arguments: Array, // TODO: $ReadOnlyArray - typeParameters?: ?TypeParameterInstantiation, // TODO: Not in spec + typeParameters?: ?TypeParameterInstantiationBase, // TODO: Not in spec }; export type CallExpression = CallOrNewBase & { @@ -572,7 +572,7 @@ export type Accessibility = "public" | "protected" | "private"; export type PatternBase = HasDecorators & { // TODO: All not in spec // Flow/TypeScript only: - typeAnnotation?: ?TypeAnnotation, + typeAnnotation?: ?TypeAnnotationBase, }; export type AssignmentProperty = ObjectProperty & { @@ -611,8 +611,8 @@ export type ClassBase = HasDecorators & { decorators: $ReadOnlyArray, // TODO: All not in spec - typeParameters?: ?TypeParameterDeclaration, - superTypeParameters?: ?TypeParameterInstantiation, + typeParameters?: ?TypeParameterDeclarationBase, + superTypeParameters?: ?TypeParameterInstantiationBase, implements?: | ?$ReadOnlyArray | $ReadOnlyArray, @@ -677,7 +677,7 @@ export type ClassProperty = ClassMemberBase & { key: Expression, value: ?Expression, // TODO: Not in spec that this is nullable. - typeAnnotation?: ?TypeAnnotation, // TODO: Not in spec + typeAnnotation?: ?TypeAnnotationBase, // TODO: Not in spec variance?: ?FlowVariance, // TODO: Not in spec // TypeScript only: (TODO: Not in spec) @@ -799,36 +799,81 @@ export type JSXElement = Node; // Flow/TypeScript common (TODO: Not in spec) +export type TypeAnnotationBase = NodeBase & { + typeAnnotation: Node, +}; + export type TypeAnnotation = NodeBase & { type: "TypeAnnotation", - typeAnnotation: TsType | FlowTypeAnnotation, + typeAnnotation: FlowTypeAnnotation, +}; + +export type TsTypeAnnotation = NodeBase & { + type: "TSTypeAnnotation", + typeAnnotation: TsType, +}; + +export type TypeParameterDeclarationBase = NodeBase & { + params: $ReadOnlyArray, }; -export type TypeParameterDeclaration = NodeBase & { +export type TypeParameterDeclaration = TypeParameterDeclarationBase & { type: "TypeParameterDeclaration", params: $ReadOnlyArray, }; -export type TypeParameter = NodeBase & { - type: "TypeParameter", +export type TsTypeParameterDeclaration = TypeParameterDeclarationBase & { + type: "TsTypeParameterDeclaration", + params: $ReadOnlyArray, +}; + +export type TypeParameterBase = NodeBase & { name: string, +}; + +export type TypeParameter = TypeParameterBase & { + type: "TypeParameter", +}; + +export type TsTypeParameter = TypeParameterBase & { + type: "TSTypeParameter", constraint?: TsType, default?: TsType, }; -export type TypeParameterInstantiation = NodeBase & { +export type TypeParameterInstantiationBase = NodeBase & { + params: $ReadOnlyArray, +}; + +export type TypeParameterInstantiation = TypeParameterInstantiationBase & { type: "TypeParameterInstantiation", - params: $ReadOnlyArray | $ReadOnlyArray, + params: $ReadOnlyArray, +}; + +export type TsTypeParameterInstantiation = TypeParameterInstantiationBase & { + type: "TSTypeParameterInstantiation", + params: $ReadOnlyArray, }; // Flow (TODO: Not in spec) +export type TypeCastExpressionBase = NodeBase & { + expression: Expression, + typeAnnotation: TypeAnnotationBase, +}; + export type TypeCastExpression = NodeBase & { type: "TypeCastExpression", expression: Expression, typeAnnotation: TypeAnnotation, }; +export type TsTypeCastExpression = NodeBase & { + type: "TSTypeCastExpression", + expression: Expression, + typeAnnotation: TsTypeAnnotation, +}; + export type FlowType = Node; export type FlowPredicate = Node; export type FlowDeclare = Node; @@ -934,11 +979,11 @@ export type TsSignatureDeclaration = export type TsSignatureDeclarationOrIndexSignatureBase = NodeBase & { // Not using TypeScript's "ParameterDeclaration" here, since it's inconsistent with regular functions. parameters: $ReadOnlyArray, - typeAnnotation: ?TypeAnnotation, + typeAnnotation: ?TsTypeAnnotation, }; export type TsSignatureDeclarationBase = TsSignatureDeclarationOrIndexSignatureBase & { - typeParameters: ?TypeParameterDeclaration, + typeParameters: ?TsTypeParameterDeclaration, }; // ================ @@ -971,7 +1016,7 @@ export type TsNamedTypeElementBase = NodeBase & { export type TsPropertySignature = TsNamedTypeElementBase & { type: "TSPropertySignature", readonly?: true, - typeAnnotation?: TypeAnnotation, + typeAnnotation?: TsTypeAnnotation, initializer?: Expression, }; @@ -1041,19 +1086,19 @@ export type TsFunctionType = TsTypeBase & export type TsConstructorType = TsTypeBase & TsSignatureDeclarationBase & { type: "TSConstructorType", - typeAnnotation: TypeAnnotation, + typeAnnotation: TsTypeAnnotation, }; export type TsTypeReference = TsTypeBase & { type: "TSTypeReference", typeName: TsEntityName, - typeParameters?: TypeParameterInstantiation, + typeParameters?: TsTypeParameterInstantiation, }; export type TsTypePredicate = TsTypeBase & { type: "TSTypePredicate", parameterName: Identifier | TsThisType, - typeAnnotation: TypeAnnotation, + typeAnnotation: TsTypeAnnotation, }; // `typeof` operator @@ -1111,7 +1156,7 @@ export type TsIndexedAccessType = TsTypeBase & { export type TsMappedType = TsTypeBase & { type: "TSMappedType", readonly?: true, - typeParameter: TypeParameter, + typeParameter: TsTypeParameter, optional?: true, typeAnnotation: ?TsType, }; @@ -1128,7 +1173,7 @@ export type TsLiteralType = TsTypeBase & { export type TsInterfaceDeclaration = DeclarationBase & { type: "TSInterfaceDeclaration", id: Identifier, - typeParameters: ?TypeParameterDeclaration, + typeParameters: ?TsTypeParameterDeclaration, // TS uses "heritageClauses", but want this to resemble ClassBase. extends?: $ReadOnlyArray, body: TSInterfaceBody, @@ -1142,13 +1187,13 @@ export type TSInterfaceBody = NodeBase & { export type TsExpressionWithTypeArguments = TsTypeBase & { type: "TSExpressionWithTypeArguments", expression: TsEntityName, - typeParameters?: TypeParameterInstantiation, + typeParameters?: TsTypeParameterInstantiation, }; export type TsTypeAliasDeclaration = DeclarationBase & { type: "TSTypeAliasDeclaration", id: Identifier, - typeParameters: ?TypeParameterDeclaration, + typeParameters: ?TsTypeParameterDeclaration, typeAnnotation: TsType, }; diff --git a/test/fixtures/typescript/arrow-function/annotated/expected.json b/test/fixtures/typescript/arrow-function/annotated/expected.json index 4c9939e4a9..2e5151144e 100644 --- a/test/fixtures/typescript/arrow-function/annotated/expected.json +++ b/test/fixtures/typescript/arrow-function/annotated/expected.json @@ -57,7 +57,7 @@ } }, "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 11, "end": 19, "loc": { @@ -108,7 +108,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 2, "end": 10, "loc": { @@ -161,4 +161,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/arrow-function/async-generic-false-positive/expected.json b/test/fixtures/typescript/arrow-function/async-generic-false-positive/expected.json index f04d318bc2..6eb11c91b9 100644 --- a/test/fixtures/typescript/arrow-function/async-generic-false-positive/expected.json +++ b/test/fixtures/typescript/arrow-function/async-generic-false-positive/expected.json @@ -157,7 +157,7 @@ }, "arguments": [], "typeParameters": { - "type": "TypeParameterInstantiation", + "type": "TSTypeParameterInstantiation", "start": 16, "end": 19, "loc": { @@ -232,4 +232,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/arrow-function/async-generic/expected.json b/test/fixtures/typescript/arrow-function/async-generic/expected.json index 5457320839..07e14382d3 100644 --- a/test/fixtures/typescript/arrow-function/async-generic/expected.json +++ b/test/fixtures/typescript/arrow-function/async-generic/expected.json @@ -57,7 +57,7 @@ } }, "typeParameters": { - "type": "TypeParameterDeclaration", + "type": "TSTypeParameterDeclaration", "start": 6, "end": 9, "loc": { @@ -72,7 +72,7 @@ }, "params": [ { - "type": "TypeParameter", + "type": "TSTypeParameter", "start": 7, "end": 8, "loc": { @@ -107,7 +107,7 @@ }, "name": "a", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 11, "end": 14, "loc": { @@ -156,7 +156,7 @@ } ], "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 15, "end": 18, "loc": { @@ -228,4 +228,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/arrow-function/async/expected.json b/test/fixtures/typescript/arrow-function/async/expected.json index 424ce9c58d..bdbbd4d0c1 100644 --- a/test/fixtures/typescript/arrow-function/async/expected.json +++ b/test/fixtures/typescript/arrow-function/async/expected.json @@ -57,7 +57,7 @@ } }, "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 18, "end": 23, "loc": { @@ -109,7 +109,7 @@ "name": "x", "optional": true, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 9, "end": 17, "loc": { @@ -162,4 +162,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/arrow-function/default-parameter-values/expected.json b/test/fixtures/typescript/arrow-function/default-parameter-values/expected.json index dd80d9124b..7a118ee403 100644 --- a/test/fixtures/typescript/arrow-function/default-parameter-values/expected.json +++ b/test/fixtures/typescript/arrow-function/default-parameter-values/expected.json @@ -92,7 +92,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 2, "end": 10, "loc": { @@ -169,4 +169,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/arrow-function/generic-tsx/expected.json b/test/fixtures/typescript/arrow-function/generic-tsx/expected.json index 0bb14a1a3b..2108e3ce7c 100644 --- a/test/fixtures/typescript/arrow-function/generic-tsx/expected.json +++ b/test/fixtures/typescript/arrow-function/generic-tsx/expected.json @@ -57,7 +57,7 @@ } }, "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 70, "end": 73, "loc": { @@ -125,7 +125,7 @@ }, "name": "a", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 66, "end": 69, "loc": { @@ -191,7 +191,7 @@ "name": "a" }, "typeParameters": { - "type": "TypeParameterDeclaration", + "type": "TSTypeParameterDeclaration", "start": 61, "end": 64, "loc": { @@ -206,7 +206,7 @@ }, "params": [ { - "type": "TypeParameter", + "type": "TSTypeParameter", "start": 62, "end": 63, "loc": { @@ -266,4 +266,4 @@ } } ] -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/arrow-function/generic/expected.json b/test/fixtures/typescript/arrow-function/generic/expected.json index 3a645e6228..efe03ee846 100644 --- a/test/fixtures/typescript/arrow-function/generic/expected.json +++ b/test/fixtures/typescript/arrow-function/generic/expected.json @@ -57,7 +57,7 @@ } }, "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 9, "end": 12, "loc": { @@ -125,7 +125,7 @@ }, "name": "a", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 5, "end": 8, "loc": { @@ -191,7 +191,7 @@ "name": "a" }, "typeParameters": { - "type": "TypeParameterDeclaration", + "type": "TSTypeParameterDeclaration", "start": 0, "end": 3, "loc": { @@ -206,7 +206,7 @@ }, "params": [ { - "type": "TypeParameter", + "type": "TSTypeParameter", "start": 1, "end": 2, "loc": { @@ -228,4 +228,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/arrow-function/optional-parameter/expected.json b/test/fixtures/typescript/arrow-function/optional-parameter/expected.json index 0fa880dc0b..6052af3280 100644 --- a/test/fixtures/typescript/arrow-function/optional-parameter/expected.json +++ b/test/fixtures/typescript/arrow-function/optional-parameter/expected.json @@ -57,7 +57,7 @@ } }, "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 12, "end": 17, "loc": { @@ -109,7 +109,7 @@ "name": "x", "optional": true, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 3, "end": 11, "loc": { @@ -162,4 +162,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/arrow-function/predicate-types/expected.json b/test/fixtures/typescript/arrow-function/predicate-types/expected.json index db5590e5ba..92cca09f8e 100644 --- a/test/fixtures/typescript/arrow-function/predicate-types/expected.json +++ b/test/fixtures/typescript/arrow-function/predicate-types/expected.json @@ -57,7 +57,7 @@ } }, "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 8, "end": 21, "loc": { @@ -102,7 +102,7 @@ "name": "x" }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 15, "end": 21, "loc": { @@ -155,7 +155,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 2, "end": 7, "loc": { @@ -207,4 +207,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/class/constructor/expected.json b/test/fixtures/typescript/class/constructor/expected.json index 260165a33e..036af003ec 100644 --- a/test/fixtures/typescript/class/constructor/expected.json +++ b/test/fixtures/typescript/class/constructor/expected.json @@ -131,7 +131,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 27, "end": 35, "loc": { @@ -178,7 +178,7 @@ }, "name": "y", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 38, "end": 46, "loc": { @@ -266,7 +266,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 66, "end": 74, "loc": { @@ -313,7 +313,7 @@ }, "name": "y", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 77, "end": 85, "loc": { @@ -401,7 +401,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 105, "end": 110, "loc": { @@ -448,7 +448,7 @@ }, "name": "y", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 113, "end": 118, "loc": { @@ -503,4 +503,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/class/declare/expected.json b/test/fixtures/typescript/class/declare/expected.json index ef56cc4a7c..bd147bd119 100644 --- a/test/fixtures/typescript/class/declare/expected.json +++ b/test/fixtures/typescript/class/declare/expected.json @@ -107,7 +107,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 26, "end": 32, "loc": { @@ -139,7 +139,7 @@ } ], "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 33, "end": 38, "loc": { @@ -238,7 +238,7 @@ "name": "x" }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 52, "end": 60, "loc": { @@ -349,7 +349,7 @@ "async": false, "params": [], "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 78, "end": 84, "loc": { @@ -386,4 +386,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/class/expression-extends-implements/expected.json b/test/fixtures/typescript/class/expression-extends-implements/expected.json index ab219ddf0a..38a24d0e62 100644 --- a/test/fixtures/typescript/class/expression-extends-implements/expected.json +++ b/test/fixtures/typescript/class/expression-extends-implements/expected.json @@ -91,7 +91,7 @@ "arguments": [] }, "superTypeParameters": { - "type": "TypeParameterInstantiation", + "type": "TSTypeParameterInstantiation", "start": 18, "end": 21, "loc": { @@ -204,7 +204,7 @@ } }, "typeParameters": { - "type": "TypeParameterInstantiation", + "type": "TSTypeParameterInstantiation", "start": 36, "end": 39, "loc": { @@ -355,7 +355,7 @@ "arguments": [] }, "superTypeParameters": { - "type": "TypeParameterInstantiation", + "type": "TSTypeParameterInstantiation", "start": 65, "end": 68, "loc": { @@ -468,7 +468,7 @@ } }, "typeParameters": { - "type": "TypeParameterInstantiation", + "type": "TSTypeParameterInstantiation", "start": 83, "end": 86, "loc": { @@ -543,4 +543,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/class/expression-extends/expected.json b/test/fixtures/typescript/class/expression-extends/expected.json index 3e7c74ca7e..384e5f9076 100644 --- a/test/fixtures/typescript/class/expression-extends/expected.json +++ b/test/fixtures/typescript/class/expression-extends/expected.json @@ -91,7 +91,7 @@ "arguments": [] }, "superTypeParameters": { - "type": "TypeParameterInstantiation", + "type": "TSTypeParameterInstantiation", "start": 18, "end": 21, "loc": { @@ -240,7 +240,7 @@ "arguments": [] }, "superTypeParameters": { - "type": "TypeParameterInstantiation", + "type": "TSTypeParameterInstantiation", "start": 47, "end": 50, "loc": { @@ -313,4 +313,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/class/expression-generic/expected.json b/test/fixtures/typescript/class/expression-generic/expected.json index f4a01c6c0c..f5be828a4b 100644 --- a/test/fixtures/typescript/class/expression-generic/expected.json +++ b/test/fixtures/typescript/class/expression-generic/expected.json @@ -58,7 +58,7 @@ }, "id": null, "typeParameters": { - "type": "TypeParameterDeclaration", + "type": "TSTypeParameterDeclaration", "start": 6, "end": 9, "loc": { @@ -73,7 +73,7 @@ }, "params": [ { - "type": "TypeParameter", + "type": "TSTypeParameter", "start": 7, "end": 8, "loc": { @@ -159,7 +159,7 @@ "name": "C" }, "typeParameters": { - "type": "TypeParameterDeclaration", + "type": "TSTypeParameterDeclaration", "start": 23, "end": 26, "loc": { @@ -174,7 +174,7 @@ }, "params": [ { - "type": "TypeParameter", + "type": "TSTypeParameter", "start": 24, "end": 25, "loc": { @@ -217,4 +217,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/class/expression-implements/expected.json b/test/fixtures/typescript/class/expression-implements/expected.json index a3ec0e0b6e..553326421a 100644 --- a/test/fixtures/typescript/class/expression-implements/expected.json +++ b/test/fixtures/typescript/class/expression-implements/expected.json @@ -122,7 +122,7 @@ } }, "typeParameters": { - "type": "TypeParameterInstantiation", + "type": "TSTypeParameterInstantiation", "start": 21, "end": 24, "loc": { @@ -305,7 +305,7 @@ } }, "typeParameters": { - "type": "TypeParameterInstantiation", + "type": "TSTypeParameterInstantiation", "start": 53, "end": 56, "loc": { @@ -380,4 +380,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/class/extends-implements/expected.json b/test/fixtures/typescript/class/extends-implements/expected.json index c8dee7a629..502c1a712f 100644 --- a/test/fixtures/typescript/class/extends-implements/expected.json +++ b/test/fixtures/typescript/class/extends-implements/expected.json @@ -93,7 +93,7 @@ "arguments": [] }, "superTypeParameters": { - "type": "TypeParameterInstantiation", + "type": "TSTypeParameterInstantiation", "start": 19, "end": 22, "loc": { @@ -206,7 +206,7 @@ } }, "typeParameters": { - "type": "TypeParameterInstantiation", + "type": "TSTypeParameterInstantiation", "start": 37, "end": 40, "loc": { @@ -276,4 +276,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/class/extends/expected.json b/test/fixtures/typescript/class/extends/expected.json index d83c52adea..151bed4e19 100644 --- a/test/fixtures/typescript/class/extends/expected.json +++ b/test/fixtures/typescript/class/extends/expected.json @@ -93,7 +93,7 @@ "arguments": [] }, "superTypeParameters": { - "type": "TypeParameterInstantiation", + "type": "TSTypeParameterInstantiation", "start": 19, "end": 22, "loc": { @@ -161,4 +161,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/class/generic/expected.json b/test/fixtures/typescript/class/generic/expected.json index 4774774452..2d114fa489 100644 --- a/test/fixtures/typescript/class/generic/expected.json +++ b/test/fixtures/typescript/class/generic/expected.json @@ -60,7 +60,7 @@ "name": "C" }, "typeParameters": { - "type": "TypeParameterDeclaration", + "type": "TSTypeParameterDeclaration", "start": 7, "end": 41, "loc": { @@ -75,7 +75,7 @@ }, "params": [ { - "type": "TypeParameter", + "type": "TSTypeParameter", "start": 8, "end": 40, "loc": { @@ -152,7 +152,7 @@ "name": "x" }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 30, "end": 38, "loc": { @@ -208,4 +208,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/class/get-generic/expected.json b/test/fixtures/typescript/class/get-generic/expected.json index a868aa656b..28eaf264cf 100644 --- a/test/fixtures/typescript/class/get-generic/expected.json +++ b/test/fixtures/typescript/class/get-generic/expected.json @@ -110,7 +110,7 @@ }, "kind": "method", "typeParameters": { - "type": "TypeParameterDeclaration", + "type": "TSTypeParameterDeclaration", "start": 25, "end": 28, "loc": { @@ -125,7 +125,7 @@ }, "params": [ { - "type": "TypeParameter", + "type": "TSTypeParameter", "start": 26, "end": 27, "loc": { @@ -148,7 +148,7 @@ "async": false, "params": [], "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 30, "end": 36, "loc": { @@ -185,4 +185,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/class/implements/expected.json b/test/fixtures/typescript/class/implements/expected.json index 4af4f8f4d0..dd732987b9 100644 --- a/test/fixtures/typescript/class/implements/expected.json +++ b/test/fixtures/typescript/class/implements/expected.json @@ -125,7 +125,7 @@ } }, "typeParameters": { - "type": "TypeParameterInstantiation", + "type": "TSTypeParameterInstantiation", "start": 22, "end": 25, "loc": { @@ -195,4 +195,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/class/index-signature/expected.json b/test/fixtures/typescript/class/index-signature/expected.json index 3c2298fc51..0fb90f1421 100644 --- a/test/fixtures/typescript/class/index-signature/expected.json +++ b/test/fixtures/typescript/class/index-signature/expected.json @@ -107,7 +107,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 18, "end": 24, "loc": { @@ -139,7 +139,7 @@ } ], "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 25, "end": 30, "loc": { @@ -202,7 +202,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 49, "end": 55, "loc": { @@ -234,7 +234,7 @@ } ], "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 56, "end": 61, "loc": { @@ -270,4 +270,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/class/members-with-modifier-names/expected.json b/test/fixtures/typescript/class/members-with-modifier-names/expected.json index 932fcdc44b..725f034a2d 100644 --- a/test/fixtures/typescript/class/members-with-modifier-names/expected.json +++ b/test/fixtures/typescript/class/members-with-modifier-names/expected.json @@ -115,7 +115,7 @@ "async": false, "params": [], "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 22, "end": 28, "loc": { @@ -186,7 +186,7 @@ "async": false, "params": [], "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 49, "end": 55, "loc": { @@ -305,7 +305,7 @@ }, "kind": "method", "typeParameters": { - "type": "TypeParameterDeclaration", + "type": "TSTypeParameterDeclaration", "start": 84, "end": 87, "loc": { @@ -320,7 +320,7 @@ }, "params": [ { - "type": "TypeParameter", + "type": "TSTypeParameter", "start": 85, "end": 86, "loc": { @@ -343,7 +343,7 @@ "async": false, "params": [], "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 89, "end": 95, "loc": { @@ -379,4 +379,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/class/members-with-reserved-names/expected.json b/test/fixtures/typescript/class/members-with-reserved-names/expected.json index b23d374bce..41ebcaecb0 100644 --- a/test/fixtures/typescript/class/members-with-reserved-names/expected.json +++ b/test/fixtures/typescript/class/members-with-reserved-names/expected.json @@ -116,7 +116,7 @@ "async": false, "params": [], "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 29, "end": 35, "loc": { @@ -152,4 +152,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/class/method-computed/expected.json b/test/fixtures/typescript/class/method-computed/expected.json index 4f2b905560..41e32efb45 100644 --- a/test/fixtures/typescript/class/method-computed/expected.json +++ b/test/fixtures/typescript/class/method-computed/expected.json @@ -148,7 +148,7 @@ "async": false, "params": [], "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 33, "end": 39, "loc": { @@ -252,7 +252,7 @@ "async": false, "params": [], "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 65, "end": 71, "loc": { @@ -288,4 +288,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/class/method-generic/expected.json b/test/fixtures/typescript/class/method-generic/expected.json index 4c113cb8b8..6e7a33919b 100644 --- a/test/fixtures/typescript/class/method-generic/expected.json +++ b/test/fixtures/typescript/class/method-generic/expected.json @@ -110,7 +110,7 @@ }, "kind": "method", "typeParameters": { - "type": "TypeParameterDeclaration", + "type": "TSTypeParameterDeclaration", "start": 15, "end": 18, "loc": { @@ -125,7 +125,7 @@ }, "params": [ { - "type": "TypeParameter", + "type": "TSTypeParameter", "start": 16, "end": 17, "loc": { @@ -164,7 +164,7 @@ }, "name": "a", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 20, "end": 23, "loc": { @@ -229,7 +229,7 @@ "name": "b", "optional": true, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 27, "end": 30, "loc": { @@ -308,7 +308,7 @@ "name": "c" }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 36, "end": 41, "loc": { @@ -372,7 +372,7 @@ } ], "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 42, "end": 45, "loc": { @@ -504,7 +504,7 @@ }, "kind": "method", "typeParameters": { - "type": "TypeParameterDeclaration", + "type": "TSTypeParameterDeclaration", "start": 70, "end": 73, "loc": { @@ -519,7 +519,7 @@ }, "params": [ { - "type": "TypeParameter", + "type": "TSTypeParameter", "start": 71, "end": 72, "loc": { @@ -542,7 +542,7 @@ "async": false, "params": [], "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 75, "end": 78, "loc": { @@ -612,4 +612,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/class/method-no-body/expected.json b/test/fixtures/typescript/class/method-no-body/expected.json index 71a82e87ca..2fdba33290 100644 --- a/test/fixtures/typescript/class/method-no-body/expected.json +++ b/test/fixtures/typescript/class/method-no-body/expected.json @@ -155,7 +155,7 @@ "async": false, "params": [], "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 26, "end": 32, "loc": { @@ -191,4 +191,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/class/method-optional/expected.json b/test/fixtures/typescript/class/method-optional/expected.json index c96beed6c2..a76097048d 100644 --- a/test/fixtures/typescript/class/method-optional/expected.json +++ b/test/fixtures/typescript/class/method-optional/expected.json @@ -116,7 +116,7 @@ "async": false, "params": [], "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 18, "end": 24, "loc": { @@ -169,4 +169,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/class/method-return-type/expected.json b/test/fixtures/typescript/class/method-return-type/expected.json index 483cb98a04..96d99504d3 100644 --- a/test/fixtures/typescript/class/method-return-type/expected.json +++ b/test/fixtures/typescript/class/method-return-type/expected.json @@ -115,7 +115,7 @@ "async": false, "params": [], "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 17, "end": 23, "loc": { @@ -168,4 +168,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/class/modifiers-properties/expected.json b/test/fixtures/typescript/class/modifiers-properties/expected.json index ebdc3a5bcd..e3358572f3 100644 --- a/test/fixtures/typescript/class/modifiers-properties/expected.json +++ b/test/fixtures/typescript/class/modifiers-properties/expected.json @@ -148,7 +148,7 @@ }, "optional": true, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 51, "end": 59, "loc": { @@ -697,4 +697,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/class/parameter-properties-with-decorators/expected.json b/test/fixtures/typescript/class/parameter-properties-with-decorators/expected.json index e0ff119eb4..bbf13dd6fb 100644 --- a/test/fixtures/typescript/class/parameter-properties-with-decorators/expected.json +++ b/test/fixtures/typescript/class/parameter-properties-with-decorators/expected.json @@ -180,7 +180,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 41, "end": 49, "loc": { @@ -236,4 +236,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/class/parameter-properties/expected.json b/test/fixtures/typescript/class/parameter-properties/expected.json index 606cfe31be..8db9ca16a0 100644 --- a/test/fixtures/typescript/class/parameter-properties/expected.json +++ b/test/fixtures/typescript/class/parameter-properties/expected.json @@ -179,7 +179,7 @@ }, "name": "pu", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 64, "end": 72, "loc": { @@ -277,7 +277,7 @@ "name": "pi", "optional": true, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 116, "end": 124, "loc": { @@ -477,7 +477,7 @@ "name": "y", "optional": true, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 239, "end": 247, "loc": { @@ -572,4 +572,4 @@ } } ] -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/class/properties/expected.json b/test/fixtures/typescript/class/properties/expected.json index 8cc2487abd..b956b43172 100644 --- a/test/fixtures/typescript/class/properties/expected.json +++ b/test/fixtures/typescript/class/properties/expected.json @@ -180,7 +180,7 @@ "name": "x" }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 30, "end": 38, "loc": { @@ -245,7 +245,7 @@ "name": "x" }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 45, "end": 53, "loc": { @@ -301,4 +301,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/class/property-computed/expected.json b/test/fixtures/typescript/class/property-computed/expected.json index 7978804e58..961a435eaa 100644 --- a/test/fixtures/typescript/class/property-computed/expected.json +++ b/test/fixtures/typescript/class/property-computed/expected.json @@ -142,7 +142,7 @@ "computed": false }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 31, "end": 39, "loc": { @@ -241,7 +241,7 @@ }, "optional": true, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 63, "end": 71, "loc": { @@ -278,4 +278,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/const/no-initializer/expected.json b/test/fixtures/typescript/const/no-initializer/expected.json index 58ccff5e4a..755d88c279 100644 --- a/test/fixtures/typescript/const/no-initializer/expected.json +++ b/test/fixtures/typescript/const/no-initializer/expected.json @@ -74,7 +74,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 7, "end": 15, "loc": { @@ -112,4 +112,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/declare/const/expected.json b/test/fixtures/typescript/declare/const/expected.json index 2d0eb59bff..86df9f11df 100644 --- a/test/fixtures/typescript/declare/const/expected.json +++ b/test/fixtures/typescript/declare/const/expected.json @@ -74,7 +74,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 15, "end": 23, "loc": { @@ -137,7 +137,7 @@ }, "name": "y", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 26, "end": 34, "loc": { @@ -176,4 +176,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/declare/destructure/expected.json b/test/fixtures/typescript/declare/destructure/expected.json index 8d28d26e0b..cb1a93f503 100644 --- a/test/fixtures/typescript/declare/destructure/expected.json +++ b/test/fixtures/typescript/declare/destructure/expected.json @@ -184,7 +184,7 @@ } ], "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 22, "end": 48, "loc": { @@ -245,7 +245,7 @@ "name": "x" }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 27, "end": 35, "loc": { @@ -308,7 +308,7 @@ "name": "y" }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 38, "end": 46, "loc": { @@ -351,4 +351,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/declare/var/expected.json b/test/fixtures/typescript/declare/var/expected.json index a790e494e6..b5083a4e86 100644 --- a/test/fixtures/typescript/declare/var/expected.json +++ b/test/fixtures/typescript/declare/var/expected.json @@ -126,7 +126,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 28, "end": 33, "loc": { @@ -165,4 +165,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/export/declare/expected.json b/test/fixtures/typescript/export/declare/expected.json index d20d41cbdd..b3f3f055d9 100644 --- a/test/fixtures/typescript/export/declare/expected.json +++ b/test/fixtures/typescript/export/declare/expected.json @@ -90,7 +90,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 22, "end": 30, "loc": { @@ -179,7 +179,7 @@ "async": false, "params": [], "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 59, "end": 65, "loc": { @@ -544,4 +544,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/function/annotated/expected.json b/test/fixtures/typescript/function/annotated/expected.json index 6b3a99c857..fdb62268bf 100644 --- a/test/fixtures/typescript/function/annotated/expected.json +++ b/test/fixtures/typescript/function/annotated/expected.json @@ -63,7 +63,7 @@ "expression": false, "async": false, "typeParameters": { - "type": "TypeParameterDeclaration", + "type": "TSTypeParameterDeclaration", "start": 10, "end": 13, "loc": { @@ -78,7 +78,7 @@ }, "params": [ { - "type": "TypeParameter", + "type": "TSTypeParameter", "start": 11, "end": 12, "loc": { @@ -114,7 +114,7 @@ "name": "x", "optional": true, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 16, "end": 19, "loc": { @@ -163,7 +163,7 @@ } ], "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 20, "end": 23, "loc": { @@ -230,4 +230,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/function/anonymous/expected.json b/test/fixtures/typescript/function/anonymous/expected.json index 0c7c8c5cca..1367ea39a2 100644 --- a/test/fixtures/typescript/function/anonymous/expected.json +++ b/test/fixtures/typescript/function/anonymous/expected.json @@ -93,7 +93,7 @@ "expression": false, "async": false, "typeParameters": { - "type": "TypeParameterDeclaration", + "type": "TSTypeParameterDeclaration", "start": 18, "end": 21, "loc": { @@ -108,7 +108,7 @@ }, "params": [ { - "type": "TypeParameter", + "type": "TSTypeParameter", "start": 19, "end": 20, "loc": { @@ -144,7 +144,7 @@ "name": "x", "optional": true, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 24, "end": 27, "loc": { @@ -193,7 +193,7 @@ } ], "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 28, "end": 31, "loc": { @@ -264,4 +264,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/function/declare/expected.json b/test/fixtures/typescript/function/declare/expected.json index 77d5677c1c..5a6f89e48c 100644 --- a/test/fixtures/typescript/function/declare/expected.json +++ b/test/fixtures/typescript/function/declare/expected.json @@ -64,7 +64,7 @@ "async": false, "params": [], "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 20, "end": 26, "loc": { @@ -130,7 +130,7 @@ "expression": false, "async": false, "typeParameters": { - "type": "TypeParameterDeclaration", + "type": "TSTypeParameterDeclaration", "start": 46, "end": 49, "loc": { @@ -145,7 +145,7 @@ }, "params": [ { - "type": "TypeParameter", + "type": "TSTypeParameter", "start": 47, "end": 48, "loc": { @@ -164,7 +164,7 @@ }, "params": [], "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 51, "end": 54, "loc": { @@ -215,4 +215,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/function/export-default/expected.json b/test/fixtures/typescript/function/export-default/expected.json index 26302894ff..5778c653ff 100644 --- a/test/fixtures/typescript/function/export-default/expected.json +++ b/test/fixtures/typescript/function/export-default/expected.json @@ -79,7 +79,7 @@ "name": "x", "optional": true, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 26, "end": 34, "loc": { @@ -111,7 +111,7 @@ } ], "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 35, "end": 41, "loc": { @@ -145,4 +145,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/function/overloads/expected.json b/test/fixtures/typescript/function/overloads/expected.json index 04801d51b3..acd9bc0685 100644 --- a/test/fixtures/typescript/function/overloads/expected.json +++ b/test/fixtures/typescript/function/overloads/expected.json @@ -96,7 +96,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 19, "end": 27, "loc": { @@ -128,7 +128,7 @@ } ], "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 28, "end": 36, "loc": { @@ -227,7 +227,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 57, "end": 65, "loc": { @@ -259,7 +259,7 @@ } ], "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 66, "end": 74, "loc": { @@ -293,4 +293,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/function/predicate-types/expected.json b/test/fixtures/typescript/function/predicate-types/expected.json index 6053c0ef64..79233238ad 100644 --- a/test/fixtures/typescript/function/predicate-types/expected.json +++ b/test/fixtures/typescript/function/predicate-types/expected.json @@ -80,7 +80,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 12, "end": 17, "loc": { @@ -112,7 +112,7 @@ } ], "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 18, "end": 32, "loc": { @@ -157,7 +157,7 @@ "name": "x" }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 25, "end": 32, "loc": { @@ -256,7 +256,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 47, "end": 52, "loc": { @@ -288,7 +288,7 @@ } ], "returnType": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 53, "end": 67, "loc": { @@ -333,7 +333,7 @@ "name": "x" }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 60, "end": 67, "loc": { @@ -390,4 +390,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/interface/call-signature/expected.json b/test/fixtures/typescript/interface/call-signature/expected.json index 61e5359a15..592614057f 100644 --- a/test/fixtures/typescript/interface/call-signature/expected.json +++ b/test/fixtures/typescript/interface/call-signature/expected.json @@ -106,7 +106,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 20, "end": 28, "loc": { @@ -138,7 +138,7 @@ } ], "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 29, "end": 35, "loc": { @@ -174,4 +174,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/interface/construct-signature/expected.json b/test/fixtures/typescript/interface/construct-signature/expected.json index 15e105e1d0..3693d03b2a 100644 --- a/test/fixtures/typescript/interface/construct-signature/expected.json +++ b/test/fixtures/typescript/interface/construct-signature/expected.json @@ -106,7 +106,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 24, "end": 32, "loc": { @@ -138,7 +138,7 @@ } ], "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 33, "end": 39, "loc": { @@ -174,4 +174,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/interface/extends/expected.json b/test/fixtures/typescript/interface/extends/expected.json index ef4064864f..85164503ee 100644 --- a/test/fixtures/typescript/interface/extends/expected.json +++ b/test/fixtures/typescript/interface/extends/expected.json @@ -124,7 +124,7 @@ } }, "typeParameters": { - "type": "TypeParameterInstantiation", + "type": "TSTypeParameterInstantiation", "start": 23, "end": 26, "loc": { @@ -194,4 +194,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/interface/generic/expected.json b/test/fixtures/typescript/interface/generic/expected.json index 7c73c06f59..26726c6f1c 100644 --- a/test/fixtures/typescript/interface/generic/expected.json +++ b/test/fixtures/typescript/interface/generic/expected.json @@ -60,7 +60,7 @@ "name": "I" }, "typeParameters": { - "type": "TypeParameterDeclaration", + "type": "TSTypeParameterDeclaration", "start": 11, "end": 45, "loc": { @@ -75,7 +75,7 @@ }, "params": [ { - "type": "TypeParameter", + "type": "TSTypeParameter", "start": 12, "end": 44, "loc": { @@ -152,7 +152,7 @@ "name": "x" }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 34, "end": 42, "loc": { @@ -207,4 +207,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/interface/index-signature/expected.json b/test/fixtures/typescript/interface/index-signature/expected.json index e3fe435449..2a5c04a9c7 100644 --- a/test/fixtures/typescript/interface/index-signature/expected.json +++ b/test/fixtures/typescript/interface/index-signature/expected.json @@ -106,7 +106,7 @@ }, "name": "s", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 22, "end": 28, "loc": { @@ -138,7 +138,7 @@ } ], "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 29, "end": 37, "loc": { @@ -174,4 +174,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/interface/method-computed/expected.json b/test/fixtures/typescript/interface/method-computed/expected.json index d703d207c3..78e9e5e9dc 100644 --- a/test/fixtures/typescript/interface/method-computed/expected.json +++ b/test/fixtures/typescript/interface/method-computed/expected.json @@ -141,7 +141,7 @@ }, "parameters": [], "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 37, "end": 43, "loc": { @@ -239,7 +239,7 @@ "optional": true, "parameters": [], "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 69, "end": 77, "loc": { @@ -275,4 +275,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/interface/method-generic/expected.json b/test/fixtures/typescript/interface/method-generic/expected.json index 9e4df1220a..6ab7ab2486 100644 --- a/test/fixtures/typescript/interface/method-generic/expected.json +++ b/test/fixtures/typescript/interface/method-generic/expected.json @@ -107,7 +107,7 @@ "name": "m" }, "typeParameters": { - "type": "TypeParameterDeclaration", + "type": "TSTypeParameterDeclaration", "start": 19, "end": 53, "loc": { @@ -122,7 +122,7 @@ }, "params": [ { - "type": "TypeParameter", + "type": "TSTypeParameter", "start": 20, "end": 52, "loc": { @@ -199,7 +199,7 @@ "name": "x" }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 42, "end": 50, "loc": { @@ -236,7 +236,7 @@ }, "parameters": [], "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 55, "end": 58, "loc": { @@ -289,4 +289,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/interface/method-optional/expected.json b/test/fixtures/typescript/interface/method-optional/expected.json index 3d52096664..96219530ec 100644 --- a/test/fixtures/typescript/interface/method-optional/expected.json +++ b/test/fixtures/typescript/interface/method-optional/expected.json @@ -109,7 +109,7 @@ "optional": true, "parameters": [], "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 22, "end": 28, "loc": { @@ -145,4 +145,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/interface/method-plain/expected.json b/test/fixtures/typescript/interface/method-plain/expected.json index 2ad1590a2a..66336652d8 100644 --- a/test/fixtures/typescript/interface/method-plain/expected.json +++ b/test/fixtures/typescript/interface/method-plain/expected.json @@ -159,7 +159,7 @@ "name": "x", "optional": true, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 31, "end": 39, "loc": { @@ -221,7 +221,7 @@ "name": "y" }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 45, "end": 55, "loc": { @@ -268,7 +268,7 @@ } ], "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 56, "end": 62, "loc": { @@ -304,4 +304,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/interface/modifiers/expected.json b/test/fixtures/typescript/interface/modifiers/expected.json index 64509cbce8..36ddaccaa5 100644 --- a/test/fixtures/typescript/interface/modifiers/expected.json +++ b/test/fixtures/typescript/interface/modifiers/expected.json @@ -108,7 +108,7 @@ }, "readonly": true, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 28, "end": 36, "loc": { @@ -144,4 +144,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/interface/properties/expected.json b/test/fixtures/typescript/interface/properties/expected.json index 71654d6806..724cc96c52 100644 --- a/test/fixtures/typescript/interface/properties/expected.json +++ b/test/fixtures/typescript/interface/properties/expected.json @@ -140,7 +140,7 @@ "name": "y" }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 26, "end": 34, "loc": { @@ -204,7 +204,7 @@ }, "optional": true, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 42, "end": 50, "loc": { @@ -240,4 +240,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/interface/property-computed/expected.json b/test/fixtures/typescript/interface/property-computed/expected.json index b859411d56..c8fce660e5 100644 --- a/test/fixtures/typescript/interface/property-computed/expected.json +++ b/test/fixtures/typescript/interface/property-computed/expected.json @@ -140,7 +140,7 @@ "computed": false }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 35, "end": 43, "loc": { @@ -237,7 +237,7 @@ }, "optional": true, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 67, "end": 75, "loc": { @@ -273,4 +273,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/interface/property-named-public/expected.json b/test/fixtures/typescript/interface/property-named-public/expected.json index 1e6b5d8e56..398b976c15 100644 --- a/test/fixtures/typescript/interface/property-named-public/expected.json +++ b/test/fixtures/typescript/interface/property-named-public/expected.json @@ -107,7 +107,7 @@ "name": "public" }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 21, "end": 29, "loc": { @@ -143,4 +143,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/interface/reserved-method-name/expected.json b/test/fixtures/typescript/interface/reserved-method-name/expected.json index e63d75c7dc..baa7894bf9 100644 --- a/test/fixtures/typescript/interface/reserved-method-name/expected.json +++ b/test/fixtures/typescript/interface/reserved-method-name/expected.json @@ -108,7 +108,7 @@ }, "parameters": [], "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 25, "end": 31, "loc": { @@ -144,4 +144,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/interface/separators/expected.json b/test/fixtures/typescript/interface/separators/expected.json index 6470be82e4..b5a74595a6 100644 --- a/test/fixtures/typescript/interface/separators/expected.json +++ b/test/fixtures/typescript/interface/separators/expected.json @@ -107,7 +107,7 @@ "name": "x" }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 19, "end": 27, "loc": { @@ -170,7 +170,7 @@ "name": "y" }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 30, "end": 38, "loc": { @@ -282,7 +282,7 @@ "name": "x" }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 59, "end": 67, "loc": { @@ -345,7 +345,7 @@ "name": "y" }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 70, "end": 78, "loc": { @@ -457,7 +457,7 @@ "name": "x" }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 106, "end": 114, "loc": { @@ -520,7 +520,7 @@ "name": "y" }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 120, "end": 128, "loc": { @@ -556,4 +556,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/module-namespace/body-declare/expected.json b/test/fixtures/typescript/module-namespace/body-declare/expected.json index 31fb26a418..29b72b3683 100644 --- a/test/fixtures/typescript/module-namespace/body-declare/expected.json +++ b/test/fixtures/typescript/module-namespace/body-declare/expected.json @@ -120,7 +120,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 33, "end": 41, "loc": { @@ -162,4 +162,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/module-namespace/body-nested-declare/expected.json b/test/fixtures/typescript/module-namespace/body-nested-declare/expected.json index 1a3d715c76..4108c0c349 100644 --- a/test/fixtures/typescript/module-namespace/body-nested-declare/expected.json +++ b/test/fixtures/typescript/module-namespace/body-nested-declare/expected.json @@ -166,7 +166,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 55, "end": 63, "loc": { @@ -211,4 +211,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/module-namespace/global-in-module/expected.json b/test/fixtures/typescript/module-namespace/global-in-module/expected.json index 1477ada618..577f1309c4 100644 --- a/test/fixtures/typescript/module-namespace/global-in-module/expected.json +++ b/test/fixtures/typescript/module-namespace/global-in-module/expected.json @@ -170,7 +170,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 47, "end": 55, "loc": { @@ -215,4 +215,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/tsx/brace-is-block/expected.json b/test/fixtures/typescript/tsx/brace-is-block/expected.json index a264091a97..0c844437fe 100644 --- a/test/fixtures/typescript/tsx/brace-is-block/expected.json +++ b/test/fixtures/typescript/tsx/brace-is-block/expected.json @@ -78,7 +78,7 @@ "name": "D" }, "superTypeParameters": { - "type": "TypeParameterInstantiation", + "type": "TSTypeParameterInstantiation", "start": 116, "end": 119, "loc": { @@ -247,4 +247,4 @@ } } ] -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/type-alias/generic-complex/expected.json b/test/fixtures/typescript/type-alias/generic-complex/expected.json index 88e59f74cd..d3d0752a89 100644 --- a/test/fixtures/typescript/type-alias/generic-complex/expected.json +++ b/test/fixtures/typescript/type-alias/generic-complex/expected.json @@ -60,7 +60,7 @@ "name": "T" }, "typeParameters": { - "type": "TypeParameterDeclaration", + "type": "TSTypeParameterDeclaration", "start": 6, "end": 40, "loc": { @@ -75,7 +75,7 @@ }, "params": [ { - "type": "TypeParameter", + "type": "TSTypeParameter", "start": 7, "end": 39, "loc": { @@ -152,7 +152,7 @@ "name": "x" }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 29, "end": 37, "loc": { @@ -219,7 +219,7 @@ "name": "Array" }, "typeParameters": { - "type": "TypeParameterInstantiation", + "type": "TSTypeParameterInstantiation", "start": 48, "end": 51, "loc": { @@ -272,4 +272,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/type-alias/generic/expected.json b/test/fixtures/typescript/type-alias/generic/expected.json index 5fbf8a028f..d678126487 100644 --- a/test/fixtures/typescript/type-alias/generic/expected.json +++ b/test/fixtures/typescript/type-alias/generic/expected.json @@ -60,7 +60,7 @@ "name": "T" }, "typeParameters": { - "type": "TypeParameterDeclaration", + "type": "TSTypeParameterDeclaration", "start": 6, "end": 9, "loc": { @@ -75,7 +75,7 @@ }, "params": [ { - "type": "TypeParameter", + "type": "TSTypeParameter", "start": 7, "end": 8, "loc": { @@ -128,4 +128,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/type-arguments/call/expected.json b/test/fixtures/typescript/type-arguments/call/expected.json index a644b276ea..fc786c74e6 100644 --- a/test/fixtures/typescript/type-arguments/call/expected.json +++ b/test/fixtures/typescript/type-arguments/call/expected.json @@ -75,7 +75,7 @@ }, "arguments": [], "typeParameters": { - "type": "TypeParameterInstantiation", + "type": "TSTypeParameterInstantiation", "start": 1, "end": 4, "loc": { @@ -172,7 +172,7 @@ }, "arguments": [], "typeParameters": { - "type": "TypeParameterInstantiation", + "type": "TSTypeParameterInstantiation", "start": 9, "end": 15, "loc": { @@ -257,4 +257,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/type-arguments/new/expected.json b/test/fixtures/typescript/type-arguments/new/expected.json index 333b5faa84..c766c79171 100644 --- a/test/fixtures/typescript/type-arguments/new/expected.json +++ b/test/fixtures/typescript/type-arguments/new/expected.json @@ -74,7 +74,7 @@ "name": "C" }, "typeParameters": { - "type": "TypeParameterInstantiation", + "type": "TSTypeParameterInstantiation", "start": 5, "end": 8, "loc": { @@ -171,7 +171,7 @@ "name": "C" }, "typeParameters": { - "type": "TypeParameterInstantiation", + "type": "TSTypeParameterInstantiation", "start": 17, "end": 23, "loc": { @@ -257,4 +257,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/type-arguments/whitespace/expected.json b/test/fixtures/typescript/type-arguments/whitespace/expected.json index b3a7ad56db..cb13db6b68 100644 --- a/test/fixtures/typescript/type-arguments/whitespace/expected.json +++ b/test/fixtures/typescript/type-arguments/whitespace/expected.json @@ -63,7 +63,7 @@ "expression": false, "async": false, "typeParameters": { - "type": "TypeParameterDeclaration", + "type": "TSTypeParameterDeclaration", "start": 10, "end": 19, "loc": { @@ -78,7 +78,7 @@ }, "params": [ { - "type": "TypeParameter", + "type": "TSTypeParameter", "start": 13, "end": 14, "loc": { @@ -117,4 +117,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/types/array/expected.json b/test/fixtures/typescript/types/array/expected.json index 544df535c4..c3ad6ce3ee 100644 --- a/test/fixtures/typescript/types/array/expected.json +++ b/test/fixtures/typescript/types/array/expected.json @@ -74,7 +74,7 @@ }, "name": "arr", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 7, "end": 19, "loc": { @@ -142,4 +142,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/types/function-generic/expected.json b/test/fixtures/typescript/types/function-generic/expected.json index 1ea2727f33..1892869ac5 100644 --- a/test/fixtures/typescript/types/function-generic/expected.json +++ b/test/fixtures/typescript/types/function-generic/expected.json @@ -74,7 +74,7 @@ }, "name": "f", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 5, "end": 21, "loc": { @@ -102,7 +102,7 @@ } }, "typeParameters": { - "type": "TypeParameterDeclaration", + "type": "TSTypeParameterDeclaration", "start": 7, "end": 10, "loc": { @@ -117,7 +117,7 @@ }, "params": [ { - "type": "TypeParameter", + "type": "TSTypeParameter", "start": 8, "end": 9, "loc": { @@ -152,7 +152,7 @@ }, "name": "a", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 12, "end": 15, "loc": { @@ -201,7 +201,7 @@ } ], "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 17, "end": 21, "loc": { @@ -258,4 +258,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/types/function-in-generic/expected.json b/test/fixtures/typescript/types/function-in-generic/expected.json index 89e8e68bad..b41c055bd5 100644 --- a/test/fixtures/typescript/types/function-in-generic/expected.json +++ b/test/fixtures/typescript/types/function-in-generic/expected.json @@ -74,7 +74,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 5, "end": 24, "loc": { @@ -119,7 +119,7 @@ "name": "Array" }, "typeParameters": { - "type": "TypeParameterInstantiation", + "type": "TSTypeParameterInstantiation", "start": 12, "end": 24, "loc": { @@ -149,7 +149,7 @@ }, "parameters": [], "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 16, "end": 23, "loc": { @@ -192,4 +192,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/types/function-with-this/expected.json b/test/fixtures/typescript/types/function-with-this/expected.json index fc64db43de..a9cecff60f 100644 --- a/test/fixtures/typescript/types/function-with-this/expected.json +++ b/test/fixtures/typescript/types/function-with-this/expected.json @@ -74,7 +74,7 @@ }, "name": "f", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 5, "end": 29, "loc": { @@ -119,7 +119,7 @@ }, "name": "this", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 12, "end": 20, "loc": { @@ -151,7 +151,7 @@ } ], "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 22, "end": 29, "loc": { @@ -191,4 +191,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/types/function/expected.json b/test/fixtures/typescript/types/function/expected.json index 1a07ff6407..0266c62539 100644 --- a/test/fixtures/typescript/types/function/expected.json +++ b/test/fixtures/typescript/types/function/expected.json @@ -74,7 +74,7 @@ }, "name": "f", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 5, "end": 54, "loc": { @@ -119,7 +119,7 @@ }, "name": "a", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 9, "end": 17, "loc": { @@ -167,7 +167,7 @@ "name": "b", "optional": true, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 21, "end": 29, "loc": { @@ -229,7 +229,7 @@ "name": "c" }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 35, "end": 45, "loc": { @@ -276,7 +276,7 @@ } ], "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 47, "end": 54, "loc": { @@ -316,4 +316,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/types/indexed/expected.json b/test/fixtures/typescript/types/indexed/expected.json index 0524607a50..17e9952a50 100644 --- a/test/fixtures/typescript/types/indexed/expected.json +++ b/test/fixtures/typescript/types/indexed/expected.json @@ -74,7 +74,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 5, "end": 11, "loc": { @@ -176,4 +176,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/types/keywords/expected.json b/test/fixtures/typescript/types/keywords/expected.json index aef7589aae..6d2bf6bab3 100644 --- a/test/fixtures/typescript/types/keywords/expected.json +++ b/test/fixtures/typescript/types/keywords/expected.json @@ -74,7 +74,7 @@ }, "name": "a", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 5, "end": 10, "loc": { @@ -155,7 +155,7 @@ }, "name": "b", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 17, "end": 26, "loc": { @@ -236,7 +236,7 @@ }, "name": "ne", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 34, "end": 41, "loc": { @@ -317,7 +317,7 @@ }, "name": "nul", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 50, "end": 56, "loc": { @@ -398,7 +398,7 @@ }, "name": "num", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 65, "end": 73, "loc": { @@ -479,7 +479,7 @@ }, "name": "o", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 80, "end": 88, "loc": { @@ -560,7 +560,7 @@ }, "name": "st", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 96, "end": 104, "loc": { @@ -641,7 +641,7 @@ }, "name": "sy", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 112, "end": 120, "loc": { @@ -722,7 +722,7 @@ }, "name": "u", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 127, "end": 138, "loc": { @@ -803,7 +803,7 @@ }, "name": "v", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 145, "end": 151, "loc": { @@ -841,4 +841,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/types/literal-boolean/expected.json b/test/fixtures/typescript/types/literal-boolean/expected.json index 6b0526b882..0ff1d7a1db 100644 --- a/test/fixtures/typescript/types/literal-boolean/expected.json +++ b/test/fixtures/typescript/types/literal-boolean/expected.json @@ -74,7 +74,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 5, "end": 11, "loc": { @@ -171,7 +171,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 18, "end": 25, "loc": { @@ -225,4 +225,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/types/literal-number-negative/expected.json b/test/fixtures/typescript/types/literal-number-negative/expected.json index 32eff1d795..10eb0df16c 100644 --- a/test/fixtures/typescript/types/literal-number-negative/expected.json +++ b/test/fixtures/typescript/types/literal-number-negative/expected.json @@ -74,7 +74,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 5, "end": 9, "loc": { @@ -132,4 +132,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/types/literal-number/expected.json b/test/fixtures/typescript/types/literal-number/expected.json index 32e844e17f..56642c8900 100644 --- a/test/fixtures/typescript/types/literal-number/expected.json +++ b/test/fixtures/typescript/types/literal-number/expected.json @@ -74,7 +74,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 5, "end": 8, "loc": { @@ -132,4 +132,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/types/literal-string/expected.json b/test/fixtures/typescript/types/literal-string/expected.json index 842cf493b2..980e55a467 100644 --- a/test/fixtures/typescript/types/literal-string/expected.json +++ b/test/fixtures/typescript/types/literal-string/expected.json @@ -74,7 +74,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 5, "end": 12, "loc": { @@ -132,4 +132,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/types/mapped/expected.json b/test/fixtures/typescript/types/mapped/expected.json index 441c47e824..1806d688fd 100644 --- a/test/fixtures/typescript/types/mapped/expected.json +++ b/test/fixtures/typescript/types/mapped/expected.json @@ -74,7 +74,7 @@ }, "name": "map", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 7, "end": 35, "loc": { @@ -102,7 +102,7 @@ } }, "typeParameter": { - "type": "TypeParameter", + "type": "TSTypeParameter", "start": 12, "end": 23, "loc": { @@ -201,7 +201,7 @@ }, "name": "map", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 44, "end": 82, "loc": { @@ -230,7 +230,7 @@ }, "readonly": true, "typeParameter": { - "type": "TypeParameter", + "type": "TSTypeParameter", "start": 58, "end": 69, "loc": { @@ -287,4 +287,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/types/reference-generic-nested/expected.json b/test/fixtures/typescript/types/reference-generic-nested/expected.json index a0e10cfcea..5a5077fa8d 100644 --- a/test/fixtures/typescript/types/reference-generic-nested/expected.json +++ b/test/fixtures/typescript/types/reference-generic-nested/expected.json @@ -74,7 +74,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 5, "end": 27, "loc": { @@ -119,7 +119,7 @@ "name": "Array" }, "typeParameters": { - "type": "TypeParameterInstantiation", + "type": "TSTypeParameterInstantiation", "start": 12, "end": 27, "loc": { @@ -165,7 +165,7 @@ "name": "Array" }, "typeParameters": { - "type": "TypeParameterInstantiation", + "type": "TSTypeParameterInstantiation", "start": 18, "end": 26, "loc": { @@ -210,4 +210,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/types/reference-generic/expected.json b/test/fixtures/typescript/types/reference-generic/expected.json index f9132c531e..97bc623ec3 100644 --- a/test/fixtures/typescript/types/reference-generic/expected.json +++ b/test/fixtures/typescript/types/reference-generic/expected.json @@ -74,7 +74,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 5, "end": 20, "loc": { @@ -119,7 +119,7 @@ "name": "Array" }, "typeParameters": { - "type": "TypeParameterInstantiation", + "type": "TSTypeParameterInstantiation", "start": 12, "end": 20, "loc": { @@ -161,4 +161,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/types/reference/expected.json b/test/fixtures/typescript/types/reference/expected.json index 6bec175d53..336dded6c4 100644 --- a/test/fixtures/typescript/types/reference/expected.json +++ b/test/fixtures/typescript/types/reference/expected.json @@ -74,7 +74,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 5, "end": 8, "loc": { @@ -129,4 +129,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/types/type-literal/expected.json b/test/fixtures/typescript/types/type-literal/expected.json index 000ee5dad5..5c448f85a5 100644 --- a/test/fixtures/typescript/types/type-literal/expected.json +++ b/test/fixtures/typescript/types/type-literal/expected.json @@ -74,7 +74,7 @@ }, "name": "obj", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 7, "end": 22, "loc": { @@ -135,7 +135,7 @@ "name": "x" }, "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 12, "end": 20, "loc": { @@ -213,4 +213,4 @@ } } ] -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/types/type-operator/expected.json b/test/fixtures/typescript/types/type-operator/expected.json index 87635dfffa..e5296f76c4 100644 --- a/test/fixtures/typescript/types/type-operator/expected.json +++ b/test/fixtures/typescript/types/type-operator/expected.json @@ -74,7 +74,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 5, "end": 14, "loc": { @@ -145,4 +145,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/types/typeof/expected.json b/test/fixtures/typescript/types/typeof/expected.json index de41af47d4..2845ec8dcd 100644 --- a/test/fixtures/typescript/types/typeof/expected.json +++ b/test/fixtures/typescript/types/typeof/expected.json @@ -74,7 +74,7 @@ }, "name": "x", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 5, "end": 17, "loc": { @@ -161,4 +161,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/test/fixtures/typescript/types/union-intersection/expected.json b/test/fixtures/typescript/types/union-intersection/expected.json index cc97fa9693..5a6e733747 100644 --- a/test/fixtures/typescript/types/union-intersection/expected.json +++ b/test/fixtures/typescript/types/union-intersection/expected.json @@ -74,7 +74,7 @@ }, "name": "union", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 9, "end": 36, "loc": { @@ -202,7 +202,7 @@ }, "name": "intersection", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 54, "end": 71, "loc": { @@ -315,7 +315,7 @@ }, "name": "precedence1", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 88, "end": 115, "loc": { @@ -460,7 +460,7 @@ }, "name": "precedence2", "typeAnnotation": { - "type": "TypeAnnotation", + "type": "TSTypeAnnotation", "start": 132, "end": 159, "loc": { @@ -562,4 +562,4 @@ ], "directives": [] } -} \ No newline at end of file +}