Enable Babel transform-class-properties syntax support
Apologizes, turns out it was an ESLint issue causing , not IntelliJ. Using babel-eslint as the parser fixed it. Looks like IntelliJ is able to support the syntax just fine. =D
--------------------------------------
Original Post:
Is there a way to enable support for the new syntax(es) provided by Babel's transform-class-properties plugin?
Specifically, the arrow function for auto-bind:
class MyClass {
myMethod = () => { console.log(this); };
}
Right now, in the latest version (2017.2) it gives a "unexpected token =" error.
If there isn't a way to enable support, is there some way to disable just this error without disabling way too much?
Thanks.
请先登录再写评论。
IDEA does support class properties, you just need to make sure to set the JavaScript language version to ECMAScript 6 in Settings | Languages & Frameworks | JavaScript