Document changes in 6963 (#7441)
* Document 6963 * Minor tweaks * Minor edit * Add a note on the changed default value in options.md to keep things in sync
This commit is contained in:
1 parent
f11a94befd
commit
210db4700c
2 files changed
+12
No files matched your search
@@ -0,0 +1,10 @@
|
||||
#### Change default value for `trailingComma` to `es5` ([#6963](https://github.com/prettier/prettier/pull/6963) by [@fisker](https://github.com/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](https://medium.com/@nikgraf/why-you-should-enforce-dangling-commas-for-multiline-statements-d034c98e36f8).
|
||||
|
||||
Prettier has included an [option to configure trailing commas](https://prettier.io/docs/en/options.html#trailing-commas) since its early days, and an initiative to change the default value has been out there [for over three years](https://github.com/prettier/prettier/issues/68).
|
||||
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.
|
||||
@@ -93,6 +93,8 @@ Use single quotes instead of double quotes in JSX.
|
||||
|
||||
## Trailing Commas
|
||||
|
||||
_Default value changed from `none` to `es5` in v2.0.0_
|
||||
|
||||
Print trailing commas wherever possible when multi-line. (A single-line array, for example, never gets trailing commas.)
|
||||
|
||||
Valid options:
|
||||
|
||||
Reference in new issue
Block a user