google / gts

☂️ TypeScript style guide, formatter, and linter.
https://github.com/google/gts
Apache License 2.0
5.04k stars 203 forks source link

Enable more trailing commas, particularly in function parameters and calls #662

Open eefi opened 2 years ago

eefi commented 2 years ago

I'd like to suggest changing the Prettier trailingComma setting from es5 to all for the next gts release with breaking changes.

https://prettier.io/docs/en/options.html#trailing-commas

In particular, this would enable trailing commas in multiline function parameter lists and calls, which can help reduce commit diff noise.

The Prettier docs note that this requires ES2017 and TypeScript 2.7, but gts already specifies ES2018 and TypeScript 4.x.

calebegg commented 10 months ago

+1 to this. The internal prettier config at Google uses trailingComma: 'all'