Minor tweak to ts printer (#14392)

This commit is contained in:
fisker Cheung authored and GitHub committed 2023-02-21 16:13:21 +08:00
1 parent b113b7acbd
commit b6766551c7
1 file changed
+3 -11
+3 -11
View File
@@ -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");