问题描述:
Component name “xxxxx“ should always be multi-word.eslintvue
解决方案:
- 在项目目录中找到
.eslintrc.js
文件,rules中添加一行
"vue/multi-word-component-names":"off",
- 修改后的样例
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended'
],
parserOptions: {
parser: '@babel/eslint-parser'
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
}
}
看到这里就应该可以解决了
- 建议在
vue.config.js
文件中再添加一行
lintOnSave:false
- 添加后的展示
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
lintOnSave:false
})