Back to Prettier

18736 2

changelog_unreleased/javascript/18736-2.md

3.9.0624 B
Original Source

Improve blank line detection between statements (#18736 by @fisker)

<!-- prettier-ignore -->
jsx
// Input
const exports = text
  .matchAll(/(?<=\n)exports\.(?<specifier>\w+) = \k<specifier>;/g)
  .map((match) => match.groups.specifier)
  .toArray()
;

foo();

// Prettier stable (--no-semi)
const exports = text
  .matchAll(/(?<=\n)exports\.(?<specifier>\w+) = \k<specifier>;/g)
  .map((match) => match.groups.specifier)
  .toArray();
foo();

// Prettier main
const exports = text
  .matchAll(/(?<=\n)exports\.(?<specifier>\w+) = \k<specifier>;/g)
  .map((match) => match.groups.specifier)
  .toArray();

foo();