`semi: false`: `// prettier-ignore` before an ASI-protected statement drops its `;` (regression in 3.8)
Author: leonidazCreated Sep 28, 2026Updated Sep 28, 2026
Prettier 3.9.9 Playground link
--parser typescript
--no-semiInput:
log()
// prettier-ignore
;(new Widget).run()Output:
log()
// prettier-ignore
(new Widget).run()Second Output:
log()(
// prettier-ignore
new Widget,
).run()Expected output:
log()
// prettier-ignore
;(new Widget).run()Why?
Without the leading ; the statement continues the line before it: the second format shows the code is now log()(new Widget).run(), a different program. Prettier 3.7.4 keeps the two statements apart. Not fixed by #20088.
Related: #18790 (a comment inside the parentheses of an ASI-protected statement).
Also reproduces on main (88d8e96).
Source: prettier/prettier