使用vue-cli的时候采用eslint模式的时候,webpack格式化的时候,出现代码变红,报错, http://eslint.org/docs/rules/indent Expected indentation of 0 spaces but found 2 src/components/HelloWorld.vue:86:1 export default { ^

使用vue-cli的时候采用eslint模式的时候,webpack格式化的时候,出现代码变红,报错, http://eslint.org/docs/rules/indent Expected indentation of 0 spaces but found 2 src/components/HelloWorld.vue:86:1 export default { ^_第1张图片
image.png

使用vue-cli的时候采用eslint模式的时候,webpack格式化的时候,出现代码变红,报错, http://eslint.org/docs/rules/indent Expected indentation of 0 spaces but found 2 src/components/HelloWorld.vue:86:1 export default { ^_第2张图片
image.png

遇到这个问题,不要慌,在.eslinkrc.js文件的rules中配置‘indent’:0

rules: {
    // allow async-await
    'generator-star-spacing': 'off',
    // allow debugger during development
    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    // 配置首行缩进
    'indent':0
  }

你可能感兴趣的:(使用vue-cli的时候采用eslint模式的时候,webpack格式化的时候,出现代码变红,报错, http://eslint.org/docs/rules/indent Expected indentation of 0 spaces but found 2 src/components/HelloWorld.vue:86:1 export default { ^)