Fix displacing of comments in default switch case (#14047)

This commit is contained in:
Georgii Dolzhykov authored and GitHub committed 2022-12-29 10:13:02 +08:00
1 parent 32d46d9fa1
commit 201e02e14e
4 files changed
+111 -1

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
#### Fix displacing of comments in default switch case (#14047 by @thorn0)
It was a regression in Prettier 2.6.0.
<!-- prettier-ignore -->
```jsx
// Input
switch (state) {
default:
result = state; // no change
break;
}
// Prettier stable
switch (state) {
default: // no change
result = state;
break;
}
// Prettier main
switch (state) {
default:
result = state; // no change
break;
}
```