prettier-vscode
prettier-vscode copied to clipboard
Per-language settings for prettier, now that it's supported by VSCode.
Is your feature request related to a problem? Please describe. Prettier does not support per-language settings.
Describe the solution you'd like I should be able to use configuration like:
{
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"prettier.tabWidth": 2
}
}
Describe alternatives you've considered
I'm aware of the workaround to create a .prettierrc
file. However, I'm in a shared development environment, where I'd prefer not to commit or even .gitignore
a .prettierrc
file. While I could add it to .git/info/exclude
, this feels like a kludge.
Additional context This was previously requested in #242, #312, #892, and #1467.
Since then, microsoft/vscode#26707 has been closed, so extensions should be able to support per-language settings. The following comment suggests prettier-vscode maintainers would be open to supporting per-language settings once it's supported by VSCode.
Once vscode supports it, certainly. We could do it currently, but it's really messy.
Originally posted by @CiGit in https://github.com/prettier/prettier-vscode/issues/312#issuecomment-353108596
Potentially even better: Allow auto
or editor
as a new value for prettier.tabWidth
and make it let prettier use the (per-language definable) editor.tabSize
for ultimate consistency also when editing.
This would make conflicting tab width settings much more unlikely.
Any idea on this? It's pretty annoying for YAML :|
This is a work in progress: https://github.com/prettier/prettier-vscode/pull/2679
This issue has been labeled as stale due to inactivity. Reply to keep this issue open.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.