Report trailing comma after last array element
See original GitHub issueThis feature proposal refers to the issue i submitted to vscode-cfml. Since the issue my proposal addresses is engine-specific, it is rather an improvement for CFLint than for the CFML plugin.
In CFScript, the last element of an array isn’t allowed to have a trailing comma. Trailing commas after the last element are considered as a syntax error in Adobe ColdFusion.
coffee = [ "Cappuccino", "Espresso", "Latte macchiato", ];
This code will result in an error (except for Lucee/Railo). Would it be great effort to highlight/underline the closing bracket in order to indicate that the trailing comma is not valid?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 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 >Code Inspection: Unneeded last comma in array literal
Reports a usage of a trailing comma in an array literal. The warning is reported only when the JavaScript language version is set...
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 >New trailing comma behavior means a list will never be one ...
Due to the new trailing comma policy, lists that have black run on them as the list expands and contracts can never become...
Read more >Java array initialization list ending with a comma
A trailing comma may appear after the last expression in an array initializer and is ignored. Link · Share.
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 FreeTop 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
Top GitHub Comments
I propose that the rule(s) be configurable with values
always
andnever
.What’s the current state of this issue? 😄