preface
This article mainly records the solution of Vue eslint error component name “index” should always be multi word Vue/multi word component names.
1. Reason for error reporting
Create a project using the latest Vue-cli. When NPM run serve runs the project, an error is reported, as shown in the following figure.
The reason is that the eslint-plugin-vue version has been updated, and compared to the previous version, there are many new rules in the @8 version, the first one is ‘vue/multi-word-component-names’: ‘error’, which requires component names to be named in camel format, so index.vue will report an error.
2. Solutions
- Follow the rules and use camel naming, e.g. AppHeader.vue
- Turn off the naming convention in the .eslintrc.js file
// .eslintrc.js
module.exports = {
root: true,
env: {
node: true,
},
extends: [
"plugin:vue/vue3-essential",
"eslint:recommended",
"@vue/typescript/recommended",
"plugin:prettier/recommended",
],
parserOptions: {
ecmaVersion: 2020,
},
rules: {
"vue/multi-word-component-names": [
"error",
{
ignores: ["index"], //Component names to be ignored
},
],
},
};
Read More:
- Eslint Error:“Identifier xxx is not in camel case“
- Vscode configures eslint to solve terminal syntax error
- Vue Error compiling template: Component template should contain exactly one root element. If you
- RuntimeError: ONNX export failed: Couldn‘t export operator aten::upsample_bilinear2d
- [Solved] “Field pet in XXX.HelloController required a bean of type ‘XXX.Pet‘ that could not be found.“
- [Solved] Idea Run Error: Error running ‘Application‘: Command line is too long
- Turn off eslint checksum and resolve formatting conflicts
- How to Fix Word Opening Error: the resource dll cannot be loaded
- New Spring boot startup error Failed to auto-configure a DataSource
- [Solved] Vue Error: Failed to mount component: template or render function not defined
- [Solved] eslint Error: error Parsing error: Unexpected token <
- How to Solve Tabbarview error in Column 2021
- Vuex Use Prettier – Code formatter to format errors [How to Solve]
- [Solved] Intellij IDEA Error: Command line is too long
- [Solved] Error C1189: #error: Please use the /MD switch for _AFXDLL builds
- [Solved] element-plus Error: Failed to resolve component
- [Solved] Manifest merger failed with multiple errors, see logs
- How to Solve Error in importing scala word2vecmodel
- Error reported with decorator in vue: Parsing error: Decorators cannot be used to decorate object literal properties