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.

Trailing commas in function arguments

See original GitHub issue

What about trailing commas here?

const hero = (
  firstName,
  lastName,
  birthYear,
  superPower, // <-- this one
) => {
  // ....
};

It needs http://babeljs.io/docs/plugins/syntax-trailing-function-commas/ and it’s based on this proposal

Does AirBnB encourages the use of trailing commas here?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
ljharbcommented, Sep 25, 2016

eslint v3.6.0 now supports this, but the comma-dangle rule does not, just yet. This is now waiting on https://github.com/eslint/eslint/pull/7181.

0reactions
graingertcommented, Nov 1, 2016

@ljharb fyi this is now available

Read more comments on GitHub >

github_iconTop Results From Across the Web

10. Trailing commas in function parameter lists and calls
The ECMAScript 2017 feature “Trailing commas in function parameter lists and calls” was proposed by Jeff Morrison. 10.1 Overview #. Trailing commas in...
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 >
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 >
PHP 7.3: Trailing Commas in Function Calls - Laravel News
In PHP 7.3, trailing commas in function calls will be valid syntax. That is to say, you can use trailing commas when calling...
Read more >
Trailing commas in function arguments - Learning TypeScript 2.x
Trailing commas are the commas that are used after the last argument of a function. Using a comma after the last parameter of...
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