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?
Not yet. In general terms, we recommend stage 3 proposals only, case-by-case.
In this specific case (which is recently stage 3), eslint can not yet parse it, so we do not yet recommend it.
I'm going to leave this open until eslint can parse trailing function commas in core, and then we can update the guide and resulting linter plugins.
What's the most up-to-date upstream issue to track here? Is it https://github.com/ternjs/acorn/issues/441?
That's probably the best one, yes.
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.
@ljharb fyi this is now available
Most helpful comment
eslint v3.6.0 now supports this, but the
comma-danglerule does not, just yet. This is now waiting on https://github.com/eslint/eslint/pull/7181.