#20174·prettier

Own-line block comment after a type annotation's `:` or after `...` is unstable

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

Prettier 3.9.9

Example 1

Playground link

bash
--parser typescript

Input:

typescript
let a:
  /* c */
  T;

Output:

typescript
let a: /* c */
T;

Second Output:

typescript
let a: /* c */ T;

Example 2

Playground link

bash
--parser typescript

Input:

typescript
f(...
  /* c */
  a);

Output:

typescript
f(
  .../* c */
  a,
);

Second Output:

typescript
f(.../* c */ a);

Expected output

typescript
let a: /* c */ T;

f(.../* c */ a);

Why?

The first format prints T on the next line without indentation, and breaks the call after .../* c */. The second format joins the lines.

Related: #11777 (a multi-line comment after a type).

Also reproduces on main (88d8e96).