Improve comment printing around empty statement (#18108)
This commit is contained in:
1 parent
8d567d4f72
commit
7a20fe5c5f
15 files changed
+122
-40
No files matched your search
@@ -0,0 +1,25 @@
|
||||
#### Improve comment printing around empty statement (#18108 by @fisker)
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```jsx
|
||||
// Input
|
||||
for (
|
||||
index = 0;
|
||||
doSomething(foo[index]) !== bar && doSomething(foo[index]) !== baz;
|
||||
index ++
|
||||
) /* No op */;
|
||||
|
||||
// Prettier stable
|
||||
for (
|
||||
index = 0;
|
||||
doSomething(foo[index]) !== bar && doSomething(foo[index]) !== baz;
|
||||
index++ /* No op */
|
||||
);
|
||||
|
||||
// Prettier main
|
||||
for (
|
||||
index = 0;
|
||||
doSomething(foo[index]) !== bar && doSomething(foo[index]) !== baz;
|
||||
index++
|
||||
) /* No op */ ;
|
||||
```
|
||||
Reference in new issue
Block a user