Support type annotation for rest argument on babylon parser
This is working on the flow parser but not babylon
```js
echo 'function f(...flags: Array<boolean>) {}' | ./bin/prettier.js --stdin
function f(...flags: Array<boolean>) {}
```
This commit is contained in:
1 parent
be6e92f064
commit
35fb28bef2
1 file changed
+5
-1
+5
-1
@@ -287,7 +287,11 @@ function genericPrintNoParens(path, options, print) {
|
||||
case "SpreadProperty":
|
||||
case "SpreadPropertyPattern":
|
||||
case "RestElement":
|
||||
return concat([ "...", path.call(print, "argument") ]);
|
||||
return concat([
|
||||
"...",
|
||||
path.call(print, "argument"),
|
||||
path.call(print, "typeAnnotation")
|
||||
]);
|
||||
case "FunctionDeclaration":
|
||||
case "FunctionExpression":
|
||||
if (n.async)
|
||||
|
||||
Reference in new issue
Block a user