Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何配置 JSHint 以忽略此错误:Use '!==' to compare with ''.?
Use '!==' to compare with ''.
我希望这段代码通过:
/*jshint undef: false */ if (a == true) { }
解决办法是安装新版本的jshint:
npm install -g https://github.com/jshint/jshint/archive/1.0.0-rc4.tar.gz
然后使用这个配置:
{ "-W041": false }
最后这个命令
jshint --config jshint.json file.js
只需使用:
if (a) { }
你永远不需要== true在if声明中使用。
== true
if