Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Expression expected in PhpStorm

When I try to define callback function using

() => { }

instead of

function () {}

I get this error from PhpStorm

Error

How to fix this?

like image 841
san Avatar asked Apr 27 '16 11:04

san


1 Answers

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.

like image 199
Joe Withey Avatar answered Oct 21 '22 02:10

Joe Withey