Preserve blank line before comments above else (#18813)
This commit is contained in:
1 parent
8394315a36
commit
dba734dc12
7 files changed
+304
-25
No files matched your search
@@ -0,0 +1,30 @@
|
||||
#### Fix comments above `else` (#18813 by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```jsx
|
||||
// Input
|
||||
/* Case 1 */
|
||||
if (1) {
|
||||
}
|
||||
|
||||
/* Case 2 */
|
||||
else if (2) {
|
||||
}
|
||||
|
||||
// Prettier stable
|
||||
/* Case 1 */
|
||||
if (1) {
|
||||
} else if (2) {
|
||||
|
||||
/* Case 2 */
|
||||
}
|
||||
|
||||
// Prettier main
|
||||
/* Case 1 */
|
||||
if (1) {
|
||||
}
|
||||
|
||||
/* Case 2 */
|
||||
else if (2) {
|
||||
}
|
||||
```
|
||||
Reference in new issue
Block a user