Reputation: 5543
I have a YAML file for helm that got go template style handlebars {{ .Values.domain }}
however the formatter turns them into { { .Values.domain } }
how can I disable specific behavior.
FYI: The setting "Yaml › Format: Bracket Spacing
Print spaces between brackets in objects" is the result {{.Values.domain}}
is not valid go template syntax.
This behavior is happening with both formatters I have in VSCode prettier-vscode and redhat-developer/vscode-yaml. I have found out that vscode-yaml is using prettier underneeth.
Upvotes: 6
Views: 5785
Reputation: 295
I solved the problem by adding the following code into settings.json
"[helm]": {
"editor.formatOnSave": false
}
For open settings.json use the shortcut command ⌘
+ shift
+ P
for mac, for windows use Ctrl
+Shift
+P
.
Upvotes: 1
Reputation: 8934
I created ~/.prettierignore
file, added *.yaml, *.yml to it, then updated vscode User setting "prettier.ignorePath": "~/.prettierignore"
.
Upvotes: 0
Reputation: 6329
Check VSC settings for "space non-empty braces" (I don't remember the exact name of the setting, hence the search).
Make sure it is unchecked.
Set the default formatter for your file type to VSCode, not any formatting extension.
Upvotes: 1