eslint规则以及配置,资料大全,前端面试秘籍

“no-sparse-arrays”: 2,//禁止稀疏数组, [1,2]

“no-sync”: 0,//nodejs 禁止同步方法

“no-ternary”: 0,//禁止使用三目运算符

“no-trailing-spaces”: 1,//一行结束后面不要有空格

“no-this-before-super”: 0,//在调用super()之前不能使用this或super

“no-throw-literal”: 2,//禁止抛出字面量错误 throw “error”;

“no-undef”: 1,//不能有未定义的变量

“no-undef-init”: 2,//变量初始化时不能直接给它赋值为undefined

“no-undefined”: 2,//不能使用undefined

“no-unexpected-multiline”: 2,//避免多行表达式

“no-underscore-dangle”: 1,//标识符不能以_开头或结尾

“no-unneeded-ternary”: 2,//禁止不必要的嵌套 var isYes = answer === 1 ? true : false;

“no-unreachable”: 2,//不能有无法执行的代码

“no-unused-expressions”: 2,//禁止无用的表达式

“no-unused-vars”: [2, {“vars”: “all”, “args”: “after-used”}],//不能有声明后未被使用的变量或参数

“no-use-before-define”: 2,//未定义前不能使用

“no-useless-call”: 2,//禁止不必要的call和apply

“no-void”: 2,//禁用void操作符

“no-var”: 0,//禁用var,用let和const代替

“no-warning-comments”: [1, {

  • 25
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值