Reputation: 147
When I try to define callback function using
() => { }
instead of
function () {}
I get this error from PhpStorm
How to fix this?
Upvotes: 10
Views: 4369
Reputation: 991
In the menu:
PhpStorm > Preferences > Languages & Frameworks > Javascript
You'll see a box that says: JavaScript Language Version.
You should be able to change the option to ECMAScript 6 and apply.
Also:
PhpStorm > Preferences > Editor > File Types Find ECMAScript 6 in the list and add *.vue to the registered patterns list. You could add it to the Javascript file type to for good measure.
Upvotes: 11