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
--parser typescriptInput:
export /* c */ @dec class A {}Output:
export /* c */
@dec
class A {}Second Output:
export /* c */
@dec
class A {}Example 2
--parser typescriptInput:
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).
Source: prettier/prettier