#20175·prettier

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

Author: leonidazCreated Sep 28, 2026Updated Sep 28, 2026

Prettier 3.9.9

Example 1

Playground link

bash
--parser typescript

Input:

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

Output:

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

Second Output:

typescript
export /* c */

@dec
class A {}

Example 2

Playground link

bash
--parser typescript

Input:

typescript
export // c
@dec class A {}

Output:

typescript
export // c

@dec
class A {}

Second Output:

typescript
export // c


@dec
class A {}

Expected output

typescript
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).