jshint忽略使用'!=='与'''进行比较 [英] jshint ignore Use '!==' to compare with ''

查看:85
本文介绍了jshint忽略使用'!=='与'''进行比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何配置JSHint以忽略此错误:使用'!=='与''进行比较。

How can I configure JSHint to ignore this error: Use '!==' to compare with ''. ?

我希望这段代码通过:

/*jshint undef: false */
if (a == true) {

}


推荐答案

解决方法是安装新版本的jshint:

The solution is to install the new version of jshint:

npm install -g https://github.com/jshint/jshint /archive/1.0.0-rc4.tar.gz

然后使用此配置:

{
    "-W041": false
}

最后这个命令

jshint --config jshint.json file.js

这篇关于jshint忽略使用'!=='与'''进行比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆