vue/multi-word-component-names
Require component names to be multi-word.
| Default severity | Presets | Automatic fix | Options |
|---|---|---|---|
error |
essential, nuxt, opinionated |
No | Rule options |
Applies to: Vue SFC templates and blocks, with script context where the rule requires it.
In this template-only example, the filename is the finding. A component that declares a static name is checked by that name instead of its filename. The configured exact Item exemption does not allow another single-word name.
Bad
Thing.vue is a single-word name and is not in the configured ignores list.
Thing.vue
<template><p>Item</p></template>
Good
Item.vue is permitted by the exact configured Item exemption.
Item.vue
<template><p>Item</p></template>
Configuration (Vite+)
import { defineConfig } from "@vizejs/vite-plugin/vite-plus";
export default defineConfig({}).withVue({
linter: {
"preset": "incremental",
"rules": {
"vue/multi-word-component-names": "error"
},
"ruleOptions": {
"vue/multi-word-component-names": {
"ignores": [
"Item"
]
}
}
},
});
Then run vp run lint.