dprint
dprint copied to clipboard
Support YAML formatting
Hey, It would be great if dprint will support yaml formatting.
There's a good lib in Go for it - https://github.com/google/yamlfmt
+1 on this request :pray:
This blocks us from moving fully from prettier to dprint in a project.
In the meantime, we are using the following workaround based on dprint-plugin-exec:
{
"exec": {
"commands": [{
"command": "sh -c \"yamlfmt {{file_path}} && cat {{file_path}}\"",
"exts": ["yml", "yaml"]
}]
},
"plugins": [
"https://plugins.dprint.dev/exec-0.4.4.json"
]
}
Biome has begun working on YAML support. If that is done, we may be able to add YAML support by modifying dprint-plugin-biome. https://github.com/biomejs/biome/issues/2365
Hey guys, you don't need to wait for Biome. I made a dprint plugin that can format YAML: https://github.com/g-plane/pretty_yaml . It's WebAssembly-based, no external process needed.
Just run:
dprint config add g-plane/pretty_yaml
to install it.