question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

“Unexpected token ...” (object spread) when using `.eslintrc.js`

See original GitHub issue

Hello. This eslint config is valid JavaScript but makes the ESLint server crash with Unexpected token ....

const myGlobals = { globalA: 'A', globalB: 'B' }

module.exports = {
  globals: {
    LIVE: true,
    PRODUCTION: true,
    DEVELOPMENT: true,
    ...myGlobals
  }
}

I guess it isn’t using my current node version (latest, v9) but some other version that doesn’t support spreading? When I start the VSCode debugger, it says it is indeed using v9… I’m not too sure what’s happening as I expect my extensions to use my node version?

I could obviously use Object.assign instead, but… 😄

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:10
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
dbaeumercommented, Nov 13, 2017

The language server uses VS Codes shipped node version which is 7.9.0. I will mark this as a feature request to support using a different node version.

1reaction
Tom-Bonnikecommented, Nov 13, 2017

Oh, okay. I might give it a try myself if I ever have the time. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ESLint doesn't support spread operator in objects · Issue #10307
ESLint threw an error at me. /Users/jacobgunther/Documents/equinoxbot.xyz/src/auth.js 12:63 error Parsing error: Unexpected token .
Read more >
Spread operator and EsLint - javascript - Stack Overflow
This code works fine, but eslint show me error. Unexpected token (14:8) 12 | 13 | return { > 14 | ...state, |...
Read more >
eslint parsing error: unexpected token typescript
Unexpected token errors in ESLint parsing occur due to incompatibility between your development environment and ESLint's current parsing capabilities with the ...
Read more >
babel and eslint ERROR object-rest-spread(...) - One More Tech
error: Support for the experimental syntax 'objectRestSpread' isn't currently enabled · error Parsing error: Unexpected token ..(objectRestSpread).
Read more >
[Solved] One esLint error I can't overcome - help - Meteor forums
The problem is on line 13 of this file. The error message is : 13:22 error Parsing error: Unexpected token .. Column 22...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found