1.0.0 - Unexpected token = with static properties
See original GitHub issueWith 0.1.0 and 0.1.1, this was fine
export default class Root extends React.Component {
static propTypes = {
...
}
...
After switching to 1.0.0, eslint complains about Parsing error: Unexpected token =, referring to the
=after
propTypes`.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:54
- Comments:16
Top Results From Across the Web
SyntaxError: Unexpected token static - Stack Overflow
This error occurs since Standard ES2015(ES6) classes can only have methods, not properties. For me, ...
Read more >How I Fixed The Unexpected Token Error In Jest
I saw it on line 1, because line 1 is almost always occupied by an import statement - and there are no import...
Read more >Syntax Error When Using "targets" - Hotwire Discussion
Unexpected token for static targets = ["ingredient"] in Webpack. I am receiving this after updating to 1.0 and using the new targets functionality....
Read more >Class Constants - Manual - PHP
It's possible to reference the class using a variable. ... unexpected '$CONSTANT' (T_VARIABLE), expecting identifier (T_STRING) in constant.php
Read more >Efficient Default Property Values in TypeScript
Unexpected token. A constructor, method, accessor, or propert was expected. Therefore we settled on the convention of the protected static ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
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
But we are using es7 static properties now, and eslint still complains about it!
Yes, the transform would go in whatever runs babel. You need to add a root
"parser": "babel-eslint"
as well.This isn’t the proper venue for this kind of help tho - please feel free to join babel’s slack, or our gitter channel, or freenode on IRC.