How to turn off the prettier trailing comma in VS Code?
I go to settings. Select none
for the prettier trailing comma. Restart VS Code. Select a piece of TypeScript, press Ctrl
+ Shift
+ F
and the trailing commas still appear. How could I fix it?
prettier-vscode", If you want to disable Prettier for a specific language, you can set the editor. defaultFormatter to null .
A trailing comma, also known as a dangling or terminal comma, is a comma symbol that is typed after the last item of a list of elements. Since the introduction of the JavaScript language, trailing commas have been legal in array literals. Later, object literals joined arrays.
Since you are working on the Tour of Heroes project, it is maybe the .editorconfig file there that introduces conflicts with your VSCode Prettier settings. Try adding the following .prettierrc file at the root of your project :
{
"trailingComma": "none"
}
The .prettierrc file has the highest priority over any setting, so it should override any conflict.
Adding this line to settings.json worked for me.
"prettier.trailingComma": "none"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With