简体   繁体   English

在使用Gulp + Babel + JsHint时“使用”使用严格”的功能形式

[英]“Use the function form of ”use strict" when using Gulp + Babel + JsHint

I get this warning: 我收到此警告:

"Use the function form of "use strict"

when gulp watch my js files. 当gulp观看我的js文件时。

How to solve this? 如何解决呢? I´m using gulp, gulp-babel and gulp-jshint. 我正在使用gulp,gulp-babel和gulp-jshint。

Code ex: 代码示例:

.pipe( babel() )
.pipe( jshint( ".jshintrc" ) )

I´m not writting the 'use strict' on my code. 我不是在我的代码上写'use strict' It was generated by babel. 它是由babel生成的。

To reiterate what Bergi said in the comments, you shouldn't be linting code that you didn't write. 要重申Bergi在评论中所说的话,您不应该删除未编写的代码。 You should switch the order and run jshint before using babel. 使用babel 之前,您应该切换顺序并运行jshint。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM