Skip to content

Latest commit

 

History

History
10 lines (7 loc) · 1.11 KB

pr-6963.md

File metadata and controls

10 lines (7 loc) · 1.11 KB

[BREAKING] Change default value for trailingComma to es5 (#6963 by @fisker)

Before version 2.0, Prettier was avoiding trailing commas by default where possible. This made the resulting JavaScript compatible with now very old environments such as IE8, but implied some missed opportunities.

Prettier has included an option to configure trailing commas since its early days, and an initiative to change the default value has been out there for over three years. Finally, the default value becomes es5 instead of none in Prettier v2.0.

If the old behavior is still preferred, please configure Prettier with { "trailingComma": "none" }. There is a possibility that the default value will change to always (meaning even more trailing commas) in a future major version of Prettier as the JavaScript ecosystem further matures.