Skip to content

Recast pointlessly strips parenthesis from default exports and then fails validation #15

@nickretallack

Description

@nickretallack

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 () {});

Metadata

Metadata

Assignees

No one assigned

    Labels

    formattingUnexpected code formatting changes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions