Javascript: Trailing comma error at the end of arrow function? 19.2

Created on 8 Jan 2017  Â·  1Comment  Â·  Source: airbnb/javascript

Hello, after several months of inactivity I updated my project's dev dependencies and after running eslint it caught 10 errors in my gulpfile.babel.js

It tells me to add a comma in the last line of my arrow funcitons, but I can't understand why it's needed?

Imgur

(notice errors in line 73 and 76)

package.json

"eslint": "^3.13.0",
"eslint-config-airbnb-base": "^11.0.0",
"eslint-plugin-import": "^2.2.0",

Thanks in advance.

Reference: 19.2 - comma-dangle

question

Most helpful comment

ES2017 will allow trailing commas on function arguments, and our config requires them.

In this case, you should probably be doing this:

.pipe(data(() => (
  JSON.parse(fs.readFileSync(…))
)))

which won't require the trailing comma.

Otherwise, our rules require it.

>All comments

ES2017 will allow trailing commas on function arguments, and our config requires them.

In this case, you should probably be doing this:

.pipe(data(() => (
  JSON.parse(fs.readFileSync(…))
)))

which won't require the trailing comma.

Otherwise, our rules require it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MartialSeron picture MartialSeron  Â·  153Comments

AdamBrodzinski picture AdamBrodzinski  Â·  36Comments

ttmarek picture ttmarek  Â·  119Comments

Arnavion picture Arnavion  Â·  36Comments

architectcodes picture architectcodes  Â·  35Comments