I am having an issue with disable-line from eslint... or it might be a bad config.
here is my setup:
.eslintrc
{
"extends": "airbnb",
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
}
}
this.input.addEventListener('keypress', ({ target: { value } }) => { // eslint-disable-line
store.dispatch(changeText({ value }));
});
and the result:
app.tag.js 48:54 error Parsing error: Unexpected token
which is exactly the line that I tried to disable, any ideas what might be causing that?
thanks in advance :)
It's a parsing error. eslint-disable-line tells ESLint to disable its rules for a line, but ESLint still has to be able to parse the code.
The line in question:
this.input.addEventListener('keypress', ({ target: { value } }) => {
...relies on the parser understanding complex ES2015 destructured arguments. Apparently the version of ESLint you're using doesn't understand how to parse those (yet). (Your syntax is valid, so it's not an issue at your end. It's the ESLint parser.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With