flowts
flowts copied to clipboard
Recast pointlessly strips parenthesis from default exports and then fails validation
I'm pretty sure it didn't do this in the previous version of flowts. This issue was just introduced. Now, when I put in this input, it produces output that fails the validation because it removed some parenthesis. It doesn't actually matter, but it is a needless change.
Input:
// @flow
export default (function () {});
Output is the same regardless of the --no-prettier flag:
export default function () {}
Console:
verification failed, diff after stripping type annotations:
- Expected
+ Received
- export default (function () {});
+ export default function () {}
When I run it with --no-recast it produces this and doesn't fail validation:
export default (function () {});