Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected token on spread operator #29

Closed
sjorsjes opened this issue Jan 29, 2018 · 3 comments
Closed

Unexpected token on spread operator #29

sjorsjes opened this issue Jan 29, 2018 · 3 comments

Comments

@sjorsjes
Copy link

const obj1 = {};
const obj2 = {};
const combinedObjects = { ...obj1 , ...obj2 };

Gives the following error: [eslint] Parsing error: Unexpected token ...

@timseverien
Copy link

ESLint doesn't support object rest spread by default. Until the setting below is added to eslint-config-vi, you can add it to the .eslintrc of your project:

"parserOptions": {
  "ecmaFeatures": {
    "experimentalObjectRestSpread": true
  }
}

@ba55ie
Copy link
Contributor

ba55ie commented Jan 31, 2018

Object Rest/Spread Properties are a part of ES2018 which is finalized a couple of days ago. When ESLint supports it, we can update the ECMA version.

@ba55ie
Copy link
Contributor

ba55ie commented Feb 21, 2018

We can update the ECMA version to 2018 and use object destructuring! https://eslint.org/docs/user-guide/configuring#deprecated

@ba55ie ba55ie closed this as completed in a5155a9 Feb 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants