fix(yaml): do not insert line break before an empty map or sequence (#17513)

Co-authored-by: fisker <lionkay@gmail.com>
This commit is contained in:
Baptiste Rouxandfisker authored and GitHub committed 2025-06-20 05:33:25 +08:00
1 parent 94d6bbae8e
commit 2e608cd8f1
4 files changed
+100

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
#### Do not add line break before empty map or sequence (#16074 by @BapRx)
<!-- prettier-ignore -->
```yaml
# Input
---
myDict: {}
# comment
myList: []
# comment
# Prettier stable
---
myDict:
{}
# comment
myList:
[]
# comment
# Prettier main
---
myDict: {}
# comment
myList: []
# comment
```