ECMAScript 6支持PhpStorm 2016 [英] ECMAScript 6 support in PhpStorm 2016
本文介绍了ECMAScript 6支持PhpStorm 2016的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
gulp.js
文件中,有更新的ES6箭头函数语法: elixir(mix => {
mix.sass('app.scss')
.webpack('app.js');
});
PhpStorm 2016.2显示此代码错误:
表达式语句不是赋值或调用。
此外,代码自动格式化程序在遇到这种情况时会将所有内容都弄脏,因为它将其视为错误
如何让PhpStorm停止显示为错误?
解决方案
转到设置>语言与框架> JavaScript
然后将 JavaScript语言版本
更改为 ECMAScript 6
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?
解决方案
Go to Settings > Languages & Frameworks > JavaScript
Then change JavaScript language version
to ECMAScript 6
这篇关于ECMAScript 6支持PhpStorm 2016的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文