Back to Prettier

18963

changelog_unreleased/javascript/18963.md

3.9.0410 B
Original Source

Fix duplicated comments in empty branches with experimentalTernaries (#18963 by @kovsu)

<!-- prettier-ignore -->
jsx
// Input
condition ? ifTrue
: [
    // Hello, world!
  ];

// Prettier stable (--experimental-ternaries)
condition ? ifTrue
  // Hello, world!
: (
  [
    // Hello, world!
  ]
);

// Prettier main (--experimental-ternaries)
condition ? ifTrue : (
  [
    // Hello, world!
  ]
);