“Unexpected token ...” (object spread) when using `.eslintrc.js`
See original GitHub issueHello. 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:
- Created 6 years ago
- Reactions:10
- Comments:6 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.Oh, okay. I might give it a try myself if I ever have the time. Thank you.