Vue,ESLint踩坑之旅

主要是修改.eslintrc.js文件

indent

错误提示:
http://eslint.org/docs/rules/indent
Expected indentation of 2 spaces but found 4
因为我把项目中的缩进改成了4个了,所以会报错。
简单粗暴的解决方案:

    // 关闭缩进检查
    'indent' : 'off',

no-multiple-empty-lines

http://eslint.org/docs/rules/no-multiple-empty-lines
开发过程难免会需要预留比较多的空行出来做后续的处理,这个也可以关闭掉:

quotes

http://eslint.org/docs/rules/quotes
Strings must use singlequote
用单引号来描述一个字符串,是一个好建议,修改项目中出现的这个error

space-before-function-paren

http://eslint.org/docs/rules/space-before-function-paren
Missing space before function parentheses
好的建议,保留下来,修改出现的地方

semi

http://eslint.org/docs/rules/semi
Extra semicolon
多余的分号

no-trailing-spaces

http://eslint.org/docs/rules/no-trailing-spaces
Trailing spaces not allowed
多余的空格,在两段代码之间增加一个换行就会多出4个空格,这个先不要了
添加如下:

    'no-trailing-spaces' : ['off', 
        {
            'skipBlankLines': true,
            'ignoreComments': true,
        }
    ],

但是为什么这个不起作用!!!!!!!!明明都已经关闭了,但是还是提示这种错误。谁能告诉我~~~~

其他备用参考:
https://blog.csdn.net/helpzp2008/article/details/51507428

你可能感兴趣的:(Vue,ESLint踩坑之旅)