#19955·prettier

Unstable comment print in parenthesized arrow function body

Author: fiskerCreated Aug 30, 2026Updated Sep 15, 2026
Labelshelp wantedarea:commentsarea:idempotency

Prettier v3.9.6 Playground link

--parser babel
--single-quote

Input:

x2 = (a) => (a /* ! */ // K
)

var x2 = (a) => (a /* ! */ // K
)

x2 = (a) => ((b) => {
  c();
} /* ! */ // K
)

var x2 = (a) => ((b) => {
  c();
} /* ! */ // K
)

Output:

x2 = (a) =>
  a /* ! */; // K

var x2 = (a) =>
  a /* ! */; // K

x2 = (a) => (b) => {
  c();
} /* ! */; // K

var x2 = (a) => (b) => {
  c();
} /* ! */; // K

Second Output:

x2 = (a) => a; /* ! */ // K

var x2 = (a) => a; /* ! */ // K

x2 = (a) => (b) => {
  c();
}; /* ! */ // K

var x2 = (a) => (b) => {
  c();
}; /* ! */ // K

Expected output:

Should be stable

Why?

#19930 fixes the third case, but the others are still unstable.