diff --git a/src/language-js/print/typescript.js b/src/language-js/print/typescript.js index 3aa60ba38..52a69d2c8 100644 --- a/src/language-js/print/typescript.js +++ b/src/language-js/print/typescript.js @@ -122,14 +122,10 @@ function printTypescript(path, options, print) { case "TSAbstractPropertyDefinition": return printClassProperty(path, options, print); case "TSInterfaceHeritage": + case "TSClassImplements": case "TSExpressionWithTypeArguments": // Babel AST - parts.push(print("expression")); - - if (node.typeParameters) { - parts.push(print("typeParameters")); - } - - return parts; + case "TSInstantiationExpression": + return [print("expression"), print("typeParameters")]; case "TSTemplateLiteralType": return printTemplateLiteral(path, print, options); case "TSNamedTupleMember": @@ -140,8 +136,6 @@ function printTypescript(path, options, print) { return [print("typeAnnotation"), "?"]; case "TSInterfaceDeclaration": return printInterface(path, options, print); - case "TSClassImplements": - return [print("expression"), print("typeParameters")]; case "TSTypeParameterDeclaration": case "TSTypeParameterInstantiation": return printTypeParameters(path, options, print, "params"); @@ -419,8 +413,6 @@ function printTypescript(path, options, print) { return printJSDocType(path, print, /* token */ "?"); case "TSJSDocNonNullableType": return printJSDocType(path, print, /* token */ "!"); - case "TSInstantiationExpression": - return [print("expression"), print("typeParameters")]; default: /* c8 ignore next */ throw new UnexpectedNodeError(node, "TypeScript");