我想将 JSHint 和"use strict";
都应用到我的 Node.js 代码中,但是当我这样做时,JSHint 会抱怨:
$ jshint .
binfix.js: line 14, col 1, 'exports' is not defined.
binfix.js: line 24, col 1, 'exports' is not defined.
binfix.js: line 48, col 1, 'exports' is not defined.
使用/*jshint node:true */
选项。
@antonkovalyov再次感谢! 当我将"node": true
添加到我的.jshintrc
时,所有警告都消失了!
我添加了这个:
{
"node" : true
}
在 .jshintrc 文件中,它对我来说效果很好。 谢谢@mcandre和@valueof !
最有用的评论
我添加了这个:
在 .jshintrc 文件中,它对我来说效果很好。 谢谢@mcandre和@valueof !