Skip to content

Wrong formatting with multiline type literals with & and | #24294

Closed

Description

TypeScript Version: 2.9.0-dev.201xxxxx

Search Terms:

Code
Format the following:

type NumberOrString = {
    a: number
} & {
    b: string
};

Expected behavior:

type NumberOrString = {
    a: number
} & {
    b: string
};

Actual behavior:

type NumberOrString = {
    a: number
} & {
        b: string
    };

Playground Link:

Related Issues:

Activity

  1. added this to the milestone on May 21, 2018
  2. Kingwl commented on May 22, 2018

    @Kingwl
    Contributor

    This troubled me for a long time

  3. modified the milestones: , TypeScript 2.9.1 on May 22, 2018
  4. mhegazy commented on May 22, 2018

    @mhegazy
    ContributorAuthor

    thanks Wenlu Wang (@Kingwl) for the quick fix.

  5. locked and limited conversation to collaborators on Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: FormatterThe issue relates to the built-in formatterHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions