admin管理员组

文章数量:1345016

When I try to define callback function using

() => { }

instead of

function () {}

I get this error from PhpStorm

How to fix this?

When I try to define callback function using

() => { }

instead of

function () {}

I get this error from PhpStorm

How to fix this?

Share Improve this question asked Apr 27, 2016 at 11:39 sansan 1471 silver badge5 bronze badges 1
  • Which version of PhpStorm are you using? – Rwd Commented Apr 27, 2016 at 11:50
Add a ment  | 

1 Answer 1

Reset to default 11

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.

本文标签: javascriptExpression expected in PhpStormStack Overflow