Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ECMAScript 6 support in PhpStorm 2016

Tags:

I recently pulled in the latest Laravel 5.3. In the gulp.js file, there is the newer ES6 arrow function syntax:

elixir(mix => {     mix.sass('app.scss')        .webpack('app.js'); }); 

PhpStorm 2016.2 shows this code error on that:

Expression statement is not assignment or call. 

Additionally, the code auto-formatter mucks everything up when it encounters this because it sees it as an error.

How do I get PhpStorm to stop showing that as an error?

like image 368
eComEvo Avatar asked Sep 10 '16 23:09

eComEvo


People also ask

Does PhpStorm support JavaScript?

With PhpStorm, you can develop modern web, mobile, and desktop applications with JavaScript and Node. js. PhpStorm also supports React, Angular, Vue. js, and other frameworks and provides tight integration with various tools for web development.

How do I enable ECMAScript 6?

You can enable experimental ECMAScript features in your browser by going to chrome://flags/#enable-javascript-harmony and enabling the JavaScript Harmony flag. For some features, you may have to use Chrome Canary with the JavaScript Harmony flag enabled.

What is the difference between PhpStorm and WebStorm?

PHPStorm incorporates all the functionality that WebStorm comes equipped with (CSS, JavaScript HTML), PLUS full-fledged PHP support (and databases support).


2 Answers

Go to Settings > Languages & Frameworks > JavaScript

Then change JavaScript language version to ECMAScript 6

like image 53
ntzm Avatar answered Sep 19 '22 13:09

ntzm


MacOs: Menu > PhpStorm> Preferences > Languages & Frameworks > JavaScript and change JavaScript language version to ECMAScript 6

like image 42
Kamil Kiełczewski Avatar answered Sep 19 '22 13:09

Kamil Kiełczewski