Skip to content

Regression for flow union #4323

@vjeux

Description

@vjeux

Prettier 1.12.0
Playground link

Input:

declare class FormData  {
  append(
    options?:
      | string
      | {
          filepath?: string,
          filename?: string,
        },
  ): void;
}

Output:

declare class FormData {
  append(
    options?: | string
    | {
        filepath?: string,
        filename?: string
      }
  ): void;
}

This is a regression from 1.9. It's blocking the release of 1.12 at Facebook. We should get it fixed and send a 1.12.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:flowIssues affecting Flow-specific constructs (not general JS issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.priority:facebook blockerIssues that block Facebook from upgrading Prettier. (Facebook is a major Prettier supporter)priority:highCode is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions