Eslint坑

Eslint坑(搭架子时,规范代码,代码严谨,选择了Eslint规范)

序号报错解释备注
1.Extra semicolon能不用分号就不用分号
2.expected indentation of 2 spaces but found 4 indent首行缩进2个字符Vs Code 设置–>tabsize 2
3.New line required at end of file but not found eol-last</script>下一行要有空行</script>之后有且只有一个空白行
4.error unexpected trailing comma comma-dangle每个对象最后一个不要加逗号
5.Eslint代码注释 **//**后必须要有空格,不是不能注释
6.Unexpected trailing comma comma -dangle去掉末尾逗号unexpected trailing comma和 comma-dangle是同一个意思,同下
7.Trailing spaces not allowed no-trailing-spaces无尾随空间
8.Expected ‘===’ and insted saw ‘==’为代码严谨,做判断时,使用 ‘===’,而不是 ’==‘
9.Extra space before …在…之前有额外的空间
10.camel case驼峰风格
11.Unnecessary use of boolean literals in conditional expression在条件表达式中不必要使用布尔文字(no-unneeded-ternary)
12.Expected literal to be on the right side of ==期望文字位于右侧序号11,12一起出现 eg: 在这里插入图片描述
13.Do not use empty rulesets不要使用空规则集eg: style中,只写了类名,但是在{ }花括号内没有具体样式
14WARNING IN:Srcpages est.wpy [xmlclom warning] unclosed xml attribute.<image src=’…/images/1.png’ /> 反斜杠一定要写
15.Duplicate key ‘timetable’重复创建了timetable字段多次定义
16.暂时这些。。。。
  • 4
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值