HI,
I just having a stupid problem with the Spread Attributes ... .
I use your full config eslint (eslint-config-airbnb) who seem to implement the babel-eslint parsing.
But I have an Parsing error: Unexpected token ...
babel-eslint parsing does not seem to be used. Indeed, when I manually add the parsing into my .eslintrc, the error disappeared.
_eslintrc.json:_
{
"extends": "airbnb",
"globals": {
"app": true
},
"rules": {}
}
_package.json:_
"eslint": "^3.4.0",
"eslint-config-airbnb": "^10.0.1",
"eslint-plugin-import": "^1.14.0",
"eslint-plugin-jsx-a11y": "^2.2.1",
"eslint-plugin-react": "^6.2.0",
You have to explicitly specify the parser in your .eslintrc as babel-eslint - we don't use that parser in our config.
Object rest/spread is still stage 2, and our style guide does not yet recommend its use.
Ah ok ok sorry. I did not see these informations.
If you do not mind, do you have some recommendations about that to reading ? Why don't use that ect ect (I did not found it).
However, in your Airbnb JavaScript Style Guide(), you recommended to use spread operator to the copy of an array.
Thank you for your answer !
Array rest/spread is in ES6/ES2015 - you don't need babel-eslint for that. It's _object_ rest/spread that's just a proposal.
The reason we don't use < stage 3 proposals is simple: they're not finalized, and they're subject to change, or to be withdrawn entirely. We want to use JavaScript, and proposals aren't JavaScript yet.
Hum... Alright ! Thanks about the information. Have a nice day (or night) !
Would it be helpful if we added a note about proposals and JavaScript, along with some links to places like the TC39 proposals page?
Sure, I was surprised when answering this issue that one didn't exist already.
Sounds good. I'll prepare a PR that adds that.