YAML trailing comma optional
See original GitHub issuePrettier 1.19.1
Input:
`[update_vars, ]`
Output:
`[update_vars]`
Expected behavior:
So instead of: [update_vars]
we would get tags: [update_vars, ]
. Right now trailing commas are removed by the formatter. An option to disable the removal would already be helpful, then I could set them manually. I like trailing commas everywhere, as they remind me of the type I am dealing with.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Trailing commas - JavaScript - MDN Web Docs
JavaScript allows trailing commas wherever a comma-separated list of values is accepted and more values may be expected after the last item.
Read more >Parsing "JSON" containing trailing commas - Stack Overflow
JSON is a subset of YAML, so a YAML parser should parse most JSON. YAML's grammar allows trailing commas in sequences.
Read more >Code Syntax Style: Trailing Commas - ReSharper - JetBrains
When multiple items are separated by the comma (object, array, and collection initializers, as well as enums and switch expressions) , C# allows ......
Read more >Best practices for using trailing commas in JavaScript
A trailing comma, also known as a dangling or terminal comma, is a comma symbol that is typed after the last item of...
Read more >How to Allow Trailing Commas (Comma-Dangle) With ...
You may require trailing commas in all places of your code. Or you can require comma-dangle in multiline statements. For example, the "only- ......
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
Please use issue template otherwise the issue as closed