Why does Prettier turn trailingComma on?
See original GitHub issueThe trailingCommas option is based on esnext when Prettier is turned on. But why is this the case? Neither XO nor Prettier allow trailingComma
by default.
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Why does prettier put the trailing comma on its own and give ...
"trailingComma": "es5" says that the trailing comma is invalid after the last property. "airbnb-base" might contain a rule which conflicts with ...
Read more >Options - Prettier
This option allows you to switch between the default behavior ( auto ) and disabling this feature entirely ( off ). Valid options:...
Read more >VS Code Prettier Setting: prettier.trailingComma - YouTube
Your browser can 't play this video. Learn more. Switch camera.
Read more >Code Syntax Style: Trailing Commas - JetBrains Rider
Some developers consider the trailing comma redundant, but it has a number of benefits, especially in multi-line declarations:.
Read more >Start Using Prettier The Right Way - DEV Community
Starting in es5 we are allowed to write trailing commas in JavaScript (note they are not allowed in JSON). I love this feature...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m still not personally sold on trailing commas and it would be a pretty controversial change. I kinda agree with the code manipulation argument, but it’s never bothered me very much. The Git argument is just trying to fix the problem in the wrong place. The solution there is better Git diffs.
Sorry, I meant the other way around. But the question still stands, why enable it at all for
prettier
when it’s alwaysfalse
inxo
?