Parsing error: Unexpected token = with class properties
See original GitHub issuemac os
- ESLint Version:
3.18.0
- Node Version:
6.9.4
- npm Version:
3.10.10
What parser (default, Babel-ESLint, etc.) are you using? default
{
"extends": "airbnb",
"env": {
"browser": true
}
}
What did you do? Please include the actual source code causing the issue.
static propTypes = { <-- error here
What did you expect to happen? I’ve see a lot of related issues, but they was fixed, and I don’t understand how to fix it
What actually happened? Please include the actual, raw output from ESLint.
error Parsing error: Unexpected token =
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Eslint - `Parsing error: unexpected token =` error for assigned ...
You're using class field (a.k.a. property initializer) syntax, which is not part of ECMAScript 2015 (ES6), nor ES2016 or 2017, ...
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 >SyntaxError: Unexpected '#' used outside of class body
The JavaScript exception "Unexpected '#' used outside of class body" occurs when a hash ("#") is encountered in an unexpected context, most notably...
Read more >How To Fix - "Parsing error: Unexpected Token" in React.js or ...
Such “Unexpected token” signify a common behavioural problem – somewhere in your code a specific construct was supplied, but the system expected something ......
Read more >Unexpected token. A constructor, method Error in TS
The "Unexpected token. A constructor, method, accessor, or property was expected" error occurs when we use the var or let keywords to declare...
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
Hi @Drapegnik, thanks for the issue. Class properties are experimental syntax and are not supported by espree at this time. Please use the babel-eslint parser.
This issues began suddenly for me as well,