Print Flow optional & type annotations in function params with defaults (#4872)

Fixes #4863
This commit is contained in:
Dan Harper
2016-12-16 20:31:05 +00:00
committed by Henry Zhu
parent 01bc43464e
commit d90aaf2c76
9 changed files with 40 additions and 0 deletions

View File

@@ -30,6 +30,12 @@ export default function ({ types: t }) {
path.addComment("trailing", ":: ?");
},
AssignmentPattern: {
exit({ node }) {
node.left.optional = false;
}
},
// strip optional property from function params - facebook/fbjs#17
Function: {
exit({ node }) {