Why is vue/multi-word-component-names
rule disabled also for components?
#451
Replies: 2 comments
-
I guess the main reason behind this decision is that by default Nuxt auto-import components based on path:
So, in default configuration is completely valid to have single-word components as Nuxt would translate it to multi-word during import. |
Beta Was this translation helpful? Give feedback.
-
@mkubenka Yes, it looks like the rule is allowing single-name component only in subdirs of Only components directly inside |
Beta Was this translation helpful? Give feedback.
-
I noticed that this configuration sets the
vue/multi-word-component-names
tooff
, and it affects the following patterns (basically everything):I know that
app.vue
,error.vue
, layouts and pages are supposed to be single-word for good reasons, so it makes sense to disable this rule in these cases, but why is this turned off also for generic components in thecomponents
directory?According to the Vue style guide, components are supposed to be multi-word, to prevent possible conflicts, is there a reason why Nuxt is setting a different standard?
Please note that I'm not asking to change this rule, or to give a different preset, I am already overriding this in my projects' configs.
I'm only asking for the sake of knowledge, what is the rationale behind this choice, because maybe I'm getting this wrong and I could remove the more strict rule that I'm using myself if there is a good reason for this.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions