Skip to content

Comment between export and a decorator adds a blank line on every format #20175

Description

@leonidaz

Prettier 3.9.9

Example 1

Playground link

--parser typescript

Input:

export /* c */ @dec class A {}

Output:

export /* c */
@dec
class A {}

Second Output:

export /* c */

@dec
class A {}

Example 2

Playground link

--parser typescript

Input:

export // c
@dec class A {}

Output:

export // c

@dec
class A {}

Second Output:

export // c


@dec
class A {}

Expected output

export /* c */
@dec
class A {}

export // c
@dec
class A {}

Why?

Each format adds another blank line after the comment.

Also reproduces on main (88d8e96).

Activity

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

    area:idempotencyIssues with re-printing Prettier’s outputlang:javascriptIssues affecting JS

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions