使用 jshint 的同学,可否晒一下你的配置文件?

2014-04-26 18:39:54 +08:00
 lijinma
最近使用jshint,想看看大家的配置文件。

多谢。
6279 次点击
所在节点    Node.js
5 条回复
jsonline
2014-04-26 18:45:44 +08:00
{
"-W070": true,
"asi": true,
"bitwise": false,
"browser": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"es3": true,
"esnext": true,
"expr": true,
"forin": false,
"immed": true,
"jquery": true,
"latedef": true,
"laxcomma": true,
"newcap": false,
"noarg": true,
"node": true,
"noempty": true,
"plusplus": true,
"smarttabs": true,
"strict": true,
"sub": true,
"trailing": true,
"undef": true,
"unused": "var",
"globals": {
"define": true,
"requirejs": true,
"require": true
}
}
jsonline
2014-04-26 18:46:18 +08:00
不同项目,配置不同
lijinma
2014-04-26 18:48:36 +08:00
@jsonline 恩,了解,不过我还是想参考下别人的,学习下;

多谢
chemzqm
2014-04-27 04:46:58 +08:00

{
"sub":true,
"regexp":true,
"asi": true,
"browser": true,
"loopfunc":true,
"expr":true,
"node": true,
"es5": true,
"esnext": true,
"bitwise": true,
"curly": true,
"latedef": false,
"expr": true,
"eqeqeq": false,
"eqnull": false,
"newcap": true,
"noarg": true,
"undef": true,
"proto": true,
"strict": false,
"-W124": false, // A generator function shall contain a yield statement
"-W014": false, // Bad line breaking before ? (in tertiary operator)
"-W065": false, // Missing radix parameter to parseInt (defaults to 10)
"-W069": false, // Literal accessor is better written in dot notation
"globals": {
"describe": true,
"it": true,
"beforeEach": true,
"afterEach": true
}
}
这个配置跟个人习惯关系很大,我还改了一些jshint源码,因为有些不想看到的错误没有提供选项。
另外最好及时更新jshint项目获得更好的es6支持,如果需要的话
lijinma
2014-04-28 09:42:46 +08:00
@chemzqm 非常感谢。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/110159

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX