I'm using Prettier in VS Code. I noticed that when using format on save, Prettier adds trailing commas on the last line of an object every time.
For example, let's say I had a JS object like this:
obj = {
hello: 'hello',
world: 'world'
}
Prettier turns it into this:
obj = {
hello: 'hello',
world: 'world',
}
Notice the extra comma after
'world'
Didn't find in the settings an option to fix this.
You can update .prettierrc.json
and set option trailingComma
to none
like:
{
"trailingComma" : "none",
...
}