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:
- How to Fix Word Opening Error: the resource dll cannot be loaded
- [Solved] Vue Error: Failed to mount component: template or render function not defined
- Vue3 Warning: [Vue warn]: Extraneous non-emits event listeners (changeParentProps) were passed to component
- Vue Error compiling template: Component template should contain exactly one root element. If you
- How to Solve Error in importing scala word2vecmodel
- [Solved] Ureport2 export word error: unable to access this website
- [Solved] MathType error: please restart word to load mathtype addin properly
- [Solved] element-plus Error: Failed to resolve component
- Unknown custom element: [xxx] – did you register the component correctly…
- Tomcat startup error: Failed to start component [StandardServer[8005]] solution
- [Solved] pytorch CrossEntropyLoss Error: RuntimeError: 1D target tensor expected, multi-target not supported
- [Sp;ved] Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/ssm]
- [Solved] URIError: Failed to decode param ‘/%3C%=%20BASE_URL%20%3Estatic/index.%3C%=%20VUE_APP_INDEX_CSS_HASH%20%3E.css’
- [How to Solve Vue warn]: Unknown custom element: did you register the component correctly?
- [Solved] react Error: Can‘t perform a React state update on an unmounted component
- [Solved] Castle.MicroKernel.ComponentNotFoundException: No component for supporting the service ****** was f
- [Solved] kubeflow pipeline visualization component Error: WARNING: Running pip as the ‘root’ user can result in broken permissions and conflicting behaviour with the system package manager…
- The tree component in easyUI does not display data or displays undefined solutions
- [Solved] Rtthread DCM component dcm_cache_save interface Error: mkdir:/data failed
- Dubbo Error: HTTP method names must be tokens