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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
538 B
Markdown
Raw Normal View History

#### Preserve end-of-line comment for if statements without blocks (#12017 by @sosukesuzuki)
<!-- prettier-ignore -->
```jsx
// Input
if (condition1) expression1; // comment A
else if (condition2) expression2; // comment B
else expression3; // comment C
// Prettier stable
if (condition1) expression1;
// comment A
else if (condition2) expression2;
// comment B
else expression3; // comment C
// Prettier main
if (condition1) expression1; // comment A
else if (condition2) expression2; // comment B
else expression3; // comment C
```