Files

639 B

Fix unstable trailing comment on a parenthesized arrow chain (#19930 by @Kjubikstronk)

The parentheses around the inner arrow are redundant, so they are dropped. That leaves the comment next to the statement's semicolon, where the next format attaches it to the statement instead of to the arrow it was written against.

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

// Prettier stable (First format)
x2 = (a) => (b) => {
  c();
} /* ! */; // K

// Prettier stable (Second format)
x2 = (a) => (b) => {
  c();
}; /* ! */ // K

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