参考内容:
Vue eslint-plugin-vue  https://eslint.vuejs.org/user-guide/#installation

解决方法:

  1. 确认安装eslint-plugin-vue依赖,具体可以查看上面链接;
  2. .eslint.js配置文件中添加如下配置:
 1 module.exports = {
 2   root: true,
 3   env: {
 4     browser: true,
 5     node: true,
 6     es6: true,
 7   },
 8   parser: 'vue-eslint-parser',
 9   parserOptions: {
10     sourceType: 'module',
11   },
12   rules: {
13     indent: ['off', 2],
14     'no-tabs': 'off',
15     semi: [0],
16     'no-mixed-spaces-and-tabs': [0],
17     singleQuote: 0,
18     'space-before-function-paren': 0,
19     'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
20     'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
21   },
22 }

 

相关文章:

  • 2021-09-06
  • 2022-12-23
  • 2021-09-07
  • 2021-05-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-26
猜你喜欢
  • 2021-07-16
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-06-24
  • 2022-12-23
相关资源
相似解决方案