Skip to content

Bug with type annotation, keep removing and adding parentheses #5789

@VincentLanglet

Description

@VincentLanglet

Following #5247
I think, introduced in 30979ed

Prettier 1.16.0
Playground link

--parser typescript

Input:

const foo = (): (() => void) => (): void => null;
const bar = (): () => void => (): void => null;

Output:

const foo = (): () => void => (): void => null;
const bar = (): (() => void) => (): void => null;

Expected behavior:
A choice between (): () => void => (): void => null; and (): (() => void) => (): void => null;.
I think the second one is better.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:idempotencyIssues with re-printing Prettier’s outputlang: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.priority:highCode is printed in a way that alters the AST, breaks syntax, or is a significant regression. Urgent!status:has prIssues with an accompanying pull request. These issues will probably be fixed soon!

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions