ESlint错误总结

来源:互联网 发布:怎么样才能把淘宝做好 编辑:程序博客网 时间:2024/05/16 10:00

    1、router: function (){}   Missing space before opening brace--------  这里是空格问题,()和{}之间要有空格,就是() {}这样写 。

    2、this.$router.go('/#');  Extra semicolon   --------  这里是分号问题,能不写分号就不要写。

    3、methods: {        Trailing spaces not allowed  -------- 这里是因为 后面有空格,去掉就没问题了。

    4、 Unexpected tab character -------- 这里是因为用了tab键进行缩进,要用两个空格来代替tab键。

    5、for(let i = 0; i < this.x_tiveArr.length; i++) {} Expected space(s) after "for"   --------  两边都需要空格,应该写成for/*一个空格*/()/*一个空格*/{}这样的形式。

   6、Expected '===' and instead saw '=='  --------  只能用全等 '===' 而不能用相等 '=='

   7、Strings must use singlequote  --------  字符串只能用单引号,不能用双引号