YAML: Apply trailingComma option (#9665)
This commit is contained in:
1 parent
85e5cfaf2f
commit
702f543635
11 files changed
+753
-1
No files matched your search
@@ -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"
|
||||
]
|
||||
```
|
||||
Reference in new issue
Block a user