Back to Prettier

18751

changelog_unreleased/javascript/18751.md

3.9.0477 B
Original Source

Print leading semicolon before type cast comments (#18751 by @fisker)

<!-- prettier-ignore -->
jsx
// Input
;/** @type {string[]} */ (['foo', 'bar']).forEach(doStuff)

// Prettier stable (--no-semi, first format)
/** @type {string[]} */ ;(["foo", "bar"]).forEach(doStuff)

// Prettier stable (--no-semi, second format)
/** @type {string[]} */ ;["foo", "bar"].forEach(doStuff)

// Prettier main (--no-semi)
;/** @type {string[]} */ (["foo", "bar"]).forEach(doStuff)