How to enable `eslint` to parse spread operator?

  • 0
  • Pump00:00

I am using eslint for a javascript project. eslint failed to parse spread operator and I got this error 11:18 error Parsing error: Unexpected token ...

The code for above error is:

return { ...render }

The eslint configuration is yml file:

env:
  browser: true
  es6: true
extends: 'eslint:recommended'
parserOptions:
  ecmaVersion: 2017
  sourceType: module
  experimentalObjectRestSpread: true
rules:
  indent:
    - error
    - 4
  linebreak-style:
    - error
    - unix
  quotes:
    - error
    - single
  semi:
    - error
    - always
  no-console:
    - off
  prefer-spread: "error"
Default Asked on February 7, 2020 in Programming.
Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.