Open davidbludlow opened 1 year ago
Similar to #10. Maybe this could be a setting where you can specify the files you want trailing commas in or there could be a list of defaults.
Yes!
I propose that we either enforce trailing commas in these types of files or that we make a new setting to allow this. I imagine it looking something like
"filesWithTrailingCommas": [
"**/.vscode/extensions.json",
"**/.vscode/launch.json",
"**/.vscode/settings.json",
"**/.vscode/tasks.json",
"**/tsconfig*.json",
"**/jsconfig*.json"
]
and it could default to that value that I said right there
You may have a better idea of what to call the setting or how to structure it. I am just saying an idea.
In a perfect world, Microsoft would have decided to name those files .jsonc instead of .json, but I don't think that is going to happen :)
Hi there. I'm investigating moving my monorepo from prettier to dprint, and this issue is one of the pain points for me. An option for this would be great!
I would even go so as far to say that files like "tsconfig.json" and "./.vscode/settings.json" should be parsed as JSONC by default without the end-user having to specify anything in their config. (Because this is what VSCode reports in the bottom-right-hand-corner as what the file actually is.)
I like having trailing commas in files like:
Even though these files have .json in their name, it is common enough and acceptable to sometimes have trailing commas in these files. But dprint always removes them.