Trailing comma adds a comma to function parameters as well
See original GitHub issueIf Training comma
is activated, it adds a comma to the function parameters as well.
For example:
someFunction(somethingreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylong);
gets converted to:
someFunction(
somethingreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylong,
);
which introduces a comma at the end and breaks the code.
I love the project by the way, congrats ☺️
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Trailing commas - JavaScript - MDN Web Docs
Trailing commas (sometimes called "final commas") can be useful when adding new elements, parameters, or properties to JavaScript code.
Read more >PHP 8.0: Trailing commas are allowed in parameter lists and ...
PHP 8.0 syntax allows to leave a trailing-comma in parameter lists and closure use lists. function foo(string $foo, string $bar,) {} function() use...
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 >Why is a trailing comma in a function call not a syntax error?
Most languages accept trailing commas in comma-separated lists like argument lists or tuple or array literals. This is helpful if you split ...
Read more >ES proposal: Trailing commas in function parameter lists and ...
Why is that useful? There are two benefits. First, rearranging items is simpler, because you don't have to add and remove commas if...
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
You can also pass the
--trailing-comma
argument to the prettier cli. Try--trailing-comma es5
or--trailing-comma none
, depending on what you want.(that last was directed @brainsandspace)