vue脚手架官方项目模板关闭Eslint代码检测

当我们在vue-cli下载下来的模板上进行开发的时候,最常遇见的问题就是在编译过程中看到以下错误信息:

E:\n\src\components\HelloWorld.vue
  37:5  error  The "About" component has been registered but not used  vue/no-un
used-components

这个是运行了Eslint代码规范检测后的结果,这一类的错误提示大多数都不会影响运行,但是当有致命错误出现时候就会把错误信息埋没其中
所以我们开发一般来说都会把这个关掉,
有两种方式:
1.
在文件package.json中找到eslintConfig
在上面添加:

  "rules": {
      "vue/no-unused-components": "off"
    }
  1. 如果项目中有eslintrc.js文件,在该js模块中找到rules,增加上"vue/no-unused-components": "off"
rules: {
  "vue/no-unused-components": "off"
}
posted @ 2020-10-10 17:09  不务正业的反派角色  阅读(769)  评论(0)    收藏  举报