Skip to content
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

Support transform class properties (ES7+) #92

Closed
JustFly1984 opened this issue Jun 9, 2017 · 4 comments · Fixed by #101
Closed

Support transform class properties (ES7+) #92

JustFly1984 opened this issue Jun 9, 2017 · 4 comments · Fixed by #101

Comments

@JustFly1984
Copy link

I tried to use Synt, but get an error

/.nvm/versions/node/v8.0.0/lib/node_modules/synt/lib/similar/javascript.js:64
            throw new Error("in " + filepath + "\n\n" + err.stack);

Across whole my React app codebase I have class methods declared like:

class A extends Component {
  method = () => {
     ...
  }
}

This is babel's syntactic sugar, so you do not need to method.bind(this) in constructor anymore.

This is a bummer for me.

@brentlintner
Copy link
Owner

brentlintner commented Jun 10, 2017

Hey @JustFly1984, thanks for opening an issue. :-)

Currently JSX/ES7+ (or Babel specific) syntax is not yet supported or isn't via Esprima. See #91 (and #83 FWIW). Hoping to see if using Babylon can make everything work great, which should rightfully include apps/code like this (assuming http://babeljs.io/docs/plugins/transform-class-properties/ is this case)

@brentlintner brentlintner changed the title Unexpected token = Support transform class properties (ES7+) Jun 10, 2017
@brentlintner
Copy link
Owner

Closing this specific issue given the creation of #94. :-)

@brentlintner
Copy link
Owner

@JustFly1984 it's been a long time lol, but fwiw the latest release should support everything up to ES15 now. 😄

@brentlintner
Copy link
Owner

Still no JSX support yet though. 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants