Skip to content

Rule proposal: multi-word-component-names #245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
michalsnik opened this issue Nov 26, 2017 · 9 comments · Fixed by #1661
Closed

Rule proposal: multi-word-component-names #245

michalsnik opened this issue Nov 26, 2017 · 9 comments · Fixed by #1661

Comments

@michalsnik
Copy link
Member

We don't have a rule for checking this and it's already in style guide, so it might be a good idea to add it here too :)

More informations here:
https://vuejs.org/v2/style-guide/#Multi-word-component-names-essential

@chrisvfritz
Copy link
Contributor

Note that for .vue files, the file basename without extension should be treated as the name if a name option is not present.

@michalsnik
Copy link
Member Author

But I guess we also want to report this case @chrisvfritz, aren't we?

// Header.vue
{
  name: 'TheHeader',
  ...
}

@chrisvfritz
Copy link
Contributor

@michalsnik Yeah, if a name option is present, the filename should be ignored in this case.

@armano2
Copy link
Contributor

armano2 commented Nov 28, 2018

note that executeOnVueComponents is not triggered when 2nd parameter of Vue.component is not an object

@samboylett
Copy link

Any news on this?

@theoptz
Copy link

theoptz commented Dec 27, 2020

any updates?

@gkatsanos
Copy link

So we prefer to have to MAKE UP extra words for possibly hundreds of components instead of not using reserved words/html standard elements? This rule is quite.. exotic if I may.

@TheAlexLichter
Copy link
Contributor

This is not ideal for a pages folder which mirrors the URL structure (like nuxt has). Files like index.vue or about.vue should be fine 🙈

@FloEdelmann
Copy link
Member

FloEdelmann commented Dec 28, 2021

@gkatsanos Please see the reasoning in the Vue Style Guide: https://v3.vuejs.org/style-guide/#multi-word-component-names-essential (Specifically, it mentions "future HTML elements".)

@manniL You can disable this rule selectively for these cases: https://eslint.org/docs/user-guide/configuring/configuration-files#cascading-and-hierarchy or https://eslint.org/docs/user-guide/configuring/configuration-files#configuration-based-on-glob-patterns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants