Skip to content

Commit 3190c8d

Browse files
committed
Add formatting option for trailing comma
See redhat-developer/yaml-language-server#1063, this PR requires that PR in order to work. Fixes redhat-developer#1112 Signed-off-by: David Thompson <davthomp@redhat.com>
1 parent ff4606f commit 3190c8d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ The following settings are supported:
4343
* `yaml.format.bracketSpacing`: Print spaces between brackets in objects
4444
* `yaml.format.proseWrap`: Always: wrap prose if it exceeds the print width, Never: never wrap the prose, Preserve: wrap prose as-is
4545
* `yaml.format.printWidth`: Specify the line length that the printer will wrap on
46+
* `yaml.format.trailingComma`: Specify if trailing commas should be used in JSON-like segments of the YAML
4647
* `yaml.validate`: Enable/disable validation feature
4748
* `yaml.hover`: Enable/disable hover
4849
* `yaml.completion`: Enable/disable autocompletion

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@
148148
"default": 80,
149149
"description": "Specify the line length that the printer will wrap on"
150150
},
151+
"yaml.format.trailingComma": {
152+
"type": "boolean",
153+
"default": true,
154+
"description": "Specify if trailing commas should be used in JSON-like segments of the YAML"
155+
},
151156
"yaml.validate": {
152157
"type": "boolean",
153158
"default": true,

0 commit comments

Comments
 (0)