Fix handling comments in labeled statements (#6984)

This commit is contained in:
Clément Dessoude authored and Simon Lydell committed 2019-11-18 06:41:44 +01:00
1 parent a1423e05b4
commit 262f27bc61
4 files changed
+39 -1

No files matched your search

@@ -0,0 +1,23 @@
#### Fix formatting of labeled statements with comments ([#6994](https://github.com/prettier/prettier/pull/6984) by [@clement26695](https://github.com/clement26695))
Formatting of comments in labeled statements was not stable
<!-- prettier-ignore -->
```jsx
// Input
loop1:
//test
const i = 3;
// Prettier stable (first output)
loop1: //test
const i = 3;
// Prettier stable (second output)
//test
loop1: const i = 3;
// Prettier master (first output)
//test
loop1: const i = 3;
```