Files
test-repo/changelog_unreleased/javascript/17998.md
T

416 B

Improve comment handing inside if statement (#17998 by @fisker)

// Input
if (foo) // comment
{
  doThing();
} else // comment for else
{
  doSomethingElse();
}

// Prettier stable
if (foo) {
  // comment
  doThing();
} // comment for else
else {
  doSomethingElse();
}

// Prettier main
if (foo) // comment
{
  doThing();
} else // comment for else
{
  doSomethingElse();
}