09月12, 2014

jshint配置

以后的js代码必须通过jshint检查

{
 "bitwise": true,//禁止使用位移
 "asi": true,//行尾;号
 "eqeqeq": true,//===
 "curly": true,//必须使用 if(){} 中的{}
 //"forin": true,//
 "freeze": true,//禁止扩展原型
 "immed": true,//立即执行代码必须有 () 
 "indent": 4,
 "latedef": true,//禁止在变量没定义前使用
 "newcap": true,//构造函数必须大写开头
 "noarg": true,//不能使用arguments.caller与arguments.callee.
 "noempty": true,//禁止使用空方法
 "plusplus": false,//++
 "quotmark": true,//引号
 "undef": true,//未定义的变量
 "unused": "strict",//形参
 "strict": true,//严格模式
 "maxlen": 115,
 "boss": false,//()中赋值
 "debug": false,
 "eqnull": false,// a == null
 "evil": false,//eval
 "expr": false,//? :
 "funcscope": false,//块内变量在外部使用
 "globalstrict": false,
 "lastsemic": true,//允许最后一个不是;
 "laxbreak": false,//不安全的换行?
 "laxcomma": false,//允许,在行首
 "loopfunc": false,//块内定义方法
 "multistr": true,//\号换行
 "notypeof": true,//不能比较无效的值
 "sub": true,// a['a'] => a.a
 "browser": true,
 "predef": [
 "seajs",
 "define"
 ]
}

网址: http://jshint.com/

本文链接:https://xuexb.com/post/227.html

-- EOF --

发表于 2014年09月12日 16:33:17 ,添加在分类 前端技术 下 ,并被添加「 前端规范 jshint 」标签 ,最后修改于 2017年03月29日 21:27:15

提醒: 本文最后更新于 3209 天前,文中所描述的信息可能已发生改变,请谨慎使用。

Comments

评论加载中...

注:如果长时间无法加载,请针对 disq.us | disquscdn.com | disqus.com 启用代理。

AltStyle によって変換されたページ (->オリジナル) /