Component name “xxx“ should always be multi-word

简介: Component name “xxx“ should always be multi-word

ESLint是一款插件化的javascript代码检测工具,用来规范开发者的代码样式与风格, 这样可以提高团队协作效率,But,刚接触的朋友们用上了它,你可能就会觉得你不会写代码了,一行代码,n个bug,各种报错层出不穷!!!


  • 解决方案:


如果是ESLint导致的错误,去ESLint官网查找自己不符合哪条rules规则,相应修改就能解决

但是这次遇到的报错并不能通过上面的方式解决



解决方案:



在项目根目录vue.config.js文件中加入以下配置即可


lintOnSave: false


  • 但是以上方法在vue3项目中依旧会报同样的错误, 这时可以在.eslintrc.js中添加以下规则


overrides: [
    {
      files: ['src/views/**/*.vue'],
      rules: {
        'vue/multi-word-component-names': 0
      }
    }
  ]
相关文章
|
5月前
|
JavaScript 索引
Component name “index“ should always be multi-word vue/multi-word-component-names
Component name “index“ should always be multi-word vue/multi-word-component-names
|
6月前
|
JavaScript
error Component name “Login“ should always be multi-word vue/multi-word-component-names【已解决】
error Component name “Login“ should always be multi-word vue/multi-word-component-names【已解决】
385 1
|
5月前
|
JavaScript
Component name “header“ should always be multi-word
Component name “header“ should always be multi-word
Warning: To load an ES module, set “type“: “module“ in the package.json or use the .mjs extension.
Warning: To load an ES module, set “type“: “module“ in the package.json or use the .mjs extension.
|
7月前
Angular启动/node_modules/@types/node/index.d.ts (20,1): Invalid ‘reference‘ directive syntax.
Angular启动/node_modules/@types/node/index.d.ts (20,1): Invalid ‘reference‘ directive syntax.
87 2
|
7月前
|
数据库
Field ‘xxx‘ doesn‘t have a default value
Field ‘xxx‘ doesn‘t have a default value
64 0
|
7月前
|
JavaScript
【Vue Error】 error Component name “product“ should always be multi-word vue/multi-word-compone……
【Vue Error】 error Component name “product“ should always be multi-word vue/multi-word-compone……
(node)Warning: Accessing non-existent property ‘xxx‘ of module exports inside circular depen
(node)Warning: Accessing non-existent property ‘xxx‘ of module exports inside circular depen
|
JavaScript
Vue中遇到的Bug( Component name “School“ should always be multi-word vue/multi-word-component-names)
Vue中遇到的Bug( Component name “School“ should always be multi-word vue/multi-word-component-names)
137 0
913 error Component name “home“ should always be multi-word vuemulti-word-component-names
913 error Component name “home“ should always be multi-word vuemulti-word-component-names
119 0