Skip to content

Commit

Permalink
print as instead of colon for babel-ts parser
Browse files Browse the repository at this point in the history
  • Loading branch information
HosokawaR committed Apr 27, 2022
1 parent 586a4b2 commit f491141
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/language-js/print/misc.js
Expand Up @@ -55,6 +55,10 @@ function printTypeAnnotation(path, options, print) {

const parentNode = path.getParentNode();

if (parentNode.type === "ArrayPattern" && options.parser === "babel-ts") {
return [" as ", print("typeAnnotation")];
}

const isFunctionDeclarationIdentifier =
parentNode.type === "DeclareFunction" && parentNode.id === node;

Expand Down

0 comments on commit f491141

Please sign in to comment.