Skip to content

Very ugly formatting for Typescript union type type assertion #4168

@ethanresnick

Description

@ethanresnick

Prettier 1.11.1
Playground link

--parser typescript

Input:

function x() {
  const permissionsChecker =
    <PermissionsChecker<any> | undefined>(<any>permissions)[receiverType];	
}

Output:

function x() {
  const permissionsChecker = <
    | PermissionsChecker<any>
    | undefined>(<any>permissions)[receiverType];
}

Expected behavior:
Ideally, I think it would leave the code as input.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions