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.

eslint 2.10.1 - Parsing error: Unexpected token

See original GitHub issue

What version of ESLint are you using? 2.10.1

What parser (default, Babel-ESLint, etc.) are you using? babel-eslint

Please show your full configuration:

module.exports = {
    "extends": "airbnb",
    "parser": "babel-eslint",
}

What did you do? Please include the actual source code causing the issue.

I have a sample demonstrating the issue at: https://github.com/michael-wolfenden/eslint-2-10-1-issue

but running eslint via webpack with:

export class Counter {
  static initialCount = 0;
}

generates the error:

C:\Dev\eslint-issue\Counter.js
  2:23  error  Parsing error: Unexpected token =

What did you expect to happen? No errors

What actually happened? Please include the actual, raw output from ESLint.

C:\Dev\eslint-issue\Counter.js
  2:23  error  Parsing error: Unexpected token =

Addition information

The issue first occurred with 2.10.0 so at first I assumed it was the same issue as #6158 , however upgrading to 2.10.1 didn’t fix the issue. It appears as though the eslint babel parser isn’t kicking in.

Another thing to note is that the issue only occurs when running eslint via webpack.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:5
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
phaistoniancommented, May 16, 2016

Any ETA on the “fix” release?

3reactions
nzakascommented, May 16, 2016

Thanks for the comments everyone - we are investigating this issue as quickly as we can. There’s some disagreement over the correct approach to fixing the problem, so we’re working to resolve that. If you are stuck in the meantime, please consider downgrading to ESLint v1.9.0 until resolved.

If you want updates, please use the “Subscribe” button instead of leaving a comment (which trigger notifications that can distract us as we’re working).

Read more comments on GitHub >

github_iconTop Results From Across the Web

ESLint Parsing error: Unexpected token - Stack Overflow
Unexpected token errors in ESLint parsing occur due to incompatibility between your development environment and ESLint's current parsing ...
Read more >
ESLint: 2.10.0 - Parsing error: Unexpected token = · Issue #312
I'm using: eslint: 2.10.0 babel-eslint: 6.0.4 and getting the following error: Parsing error: Unexpected token = which points to class ...
Read more >
ESLint: "Parsing error: Unexpected token" in Visual Studio Code
Unexpected token errors are caused by incompatibilities in your parser options and the code you're writing. In this case, I'm using a number...
Read more >
How To Fix Eslint Parsing Error For Unexpected Token "/"
Unexpected token errors are caused by incompatibilities in your parser options and the code you're writing. In this case, I'm using a number...
Read more >
[ESLint] Parsing error: unexpected token - DEV Community ‍ ‍
What is this article about? This is a solution when I saw these errors. Warning: React version not specified in eslint-plugin-react settings. ...
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