Minor tweak to ts printer (#14392)
This commit is contained in:
1 parent
b113b7acbd
commit
b6766551c7
1 file changed
+3
-11
@@ -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");
|
||||
|
||||
Reference in new issue
Block a user