-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
es6/7 class parsing failure - property declarations without semicolons - [bounty][test repo available] #1908
Comments
I think there may still be some odd parsing rules with semicolons, try
|
Indeed a single semicolon and it works (repo updated): |
fix incoming |
@rosskevin thanks for offering the bounty, but I can't accept it :) it's generous and a cool idea, so maybe move it to your next favorite bug instead! |
Thanks for the quick fix! Will definitely move it to the next one. |
@mroch - please reopen, my sample cases still fail with 0.27.0. src/es6/Fails.js:16
16: constructor (props) {
^^^^^^^^^^^ Unexpected identifier
src/es6/FooFails.js:14
14: constructor (props) {
^^^^^^^^^^^ Unexpected identifier
src/es6/ParameterizedFails.js:16
16: constructor (props) {
^^^^^^^^^^^ Unexpected identifier |
@rosskevin this didn't make it into the 0.27 branch. should be fixed in master, though. |
ah, thank you. |
version: 0.26.0
Bug description
This shows an ES2015/ES6/ES7 parsing bug - it will fail if there isn't a semicolon or static method after property declarations and before the first member method.
I first found in the test case that a constructor without a static method above it causes linting to fail on the first method with
^^^^^^^^^^^ Unexpected identifier
. After suggestion, I tried adding a semicolon which proves the parsing error.flowconfig
Same results with and without the following:
Test cases
https://github.com/rosskevin/react-flow-classes
Works (static method above)
Fails (no static method above)
Works (a single semicolon)
I proved the same in the sample repo with parameterized classes. May be related to #1171
cc @STRML
Expectation
All current failing classes in the test repo should succeed. I should not need to use any semicolons, and I don't need static methods above my constructor or member method.
The text was updated successfully, but these errors were encountered: