-
-
Notifications
You must be signed in to change notification settings - Fork 131
Closed
Labels
Milestone
Description
Take the following code:
var foos = new[]
{
new Foo(),
new Bar()
};If later a new item is added:
var foos = new[]
{
new Foo(),
new Bar(),
new Baz()
};This causes the following issues:
- A misleading commit diff of
+2/-1even though there isn't really any code deletion. - Polluting git blame.
These issues also occur when deleting/reordering the last item in initializers.
These issues can be fixed by enforcing trailing commas.
Relevant Prettier option: https://prettier.io/docs/en/options.html#trailing-commas
loraderon, jods4, curbelo-gonzalo, DemoBytom, Girildo and 19 moreglen-84 and rodrigomaia