bencodezen / vue-enterprise-boilerplate

An ever-evolving, very opinionated architecture and dev environment for new Vue SPA projects using Vue CLI.
7.78k stars 1.32k forks source link

Style: Multi-word component names #123

Closed MatthewAry closed 5 years ago

MatthewAry commented 5 years ago

As shown in https://vuejs.org/v2/style-guide/#Multi-word-component-names-essential the style guide states that it is essential that component names have multiple words. There are a few components in this project that don't follow this convention. Example: /src/router/views/home.vue

chrisvfritz commented 5 years ago

Those view components don't actually have a name, because they're never globally or locally registered for use in a template. There is a case in this project where that rule is violated though: view components all locally register their layout as Layout, which is a single word. However, referencing the description for the Essential rules:

Exceptions may exist, but should be very rare and only be made by those with expert knowledge of both JavaScript and Vue.

So it's all good. 🙂 I feel pretty confident that there won't be a <layout> element in the future that this could be confused with. As the author of the style guide, I also feel confident that I wouldn't be mad at me for this exception. 😉

Does that make sense?

chrisvfritz commented 5 years ago

I haven't heard anything, so I'm assuming it made sense and closing for now. Happy to reopen though. 🙂

axdyng commented 4 years ago

Those view components don't actually have a name, because they're never globally or locally registered for use in a template.

Since the view components aren't registered, how would you recommend to name multi worded components? For eg. forgot-password.vue or ForgotPassword.vue?

Would you then register it's route name as kebab-case or PascalCase?

I've also noticed that you have named the dynamic route path: '/profile/:username' as name: 'username-profile',

Do you follow any convention for that?

Thanks in advance!