gwl999

博客园 首页 新随笔 联系 订阅 管理

问题描述:

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
})
posted on 2022-10-29 16:10  呓雫  阅读(105)  评论(0编辑  收藏  举报