YAML: Apply trailingComma option (#9665)

This commit is contained in:
fisker Cheung authored and GitHub committed 2020-11-18 09:05:56 +08:00
1 parent 85e5cfaf2f
commit 702f543635
11 files changed
+753 -1

No files matched your search

+46
View File
@@ -0,0 +1,46 @@
#### Apply `trailingComma` option (#9665 by @fisker)
When `--trailing-comma=none`, should not add trailing comma to flowMapping and flowSequence.
<!-- prettier-ignore -->
```yaml
# Input
flow-mapping:
{
"object-does-not-fit-within-print-width": "------",
"TEST": "comma IS added here"
}
flow-sequence:
[
"object-does-not-fit-within-print-width", "------",
"TEST", "comma IS added here"
]
# Prettier stable
mapping:
{
"object-does-not-fit-within-print-width": "------",
"TEST": "comma IS added here",
}
flow-sequence:
[
"object-does-not-fit-within-print-width",
"------",
"TEST",
"comma IS added here",
]
# Prettier master
flow-mapping:
{
"object-does-not-fit-within-print-width": "------",
"TEST": "comma IS added here"
}
flow-sequence:
[
"object-does-not-fit-within-print-width",
"------",
"TEST",
"comma IS added here"
]
```