解决 error Component name “index“ should always be multi-word vue/multi-word-compo

1,612 阅读1分钟

eslint-plugin-vue版本更新了,相比较以前的版本,@8版本中新增了不少规则,第一条就是 ''vue/multi-word-component-names': 'error',要求名称以驼峰格式命名,所以index.vue会报错

解决方法有两种:

1.以驼峰的命名方式去命名组件名称。

2.找到node_modules 下的eslint-plugin-vue >>> lib >>> configs 文件夹下的 vue3.essential.js  文件 将第一句 ''vue/multi-word-component-names': 'error' 改为 ''vue/multi-word-component-names': 'off'   改完重新打开项目  项目运行不报错。