question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Report trailing comma after last array element

See original GitHub issue

This 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:open
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
KamasamaKcommented, Mar 20, 2019

I propose that the rule(s) be configurable with values always and never.

0reactions
dominikbrauncommented, Oct 1, 2019

What’s the current state of this issue? 😄

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found