vuejs / eslint-plugin-vue

Official ESLint plugin for Vue.js
https://eslint.vuejs.org/
MIT License
4.47k stars 665 forks source link

Rule proposal: `component-name-casing` #251

Closed michalsnik closed 4 years ago

michalsnik commented 6 years ago

Style guide: https://vuejs.org/v2/style-guide/#Component-name-casing-in-JS-JSX-strongly-recommended

Description: We already have a rule called name-property-casing but it only checks a property name, and dosen't care about Vue.component('TheComponent', ...) case.

This rule could either extend the name-property-casing with extra checks or simply fill the gap and check only the second case, but if someone would want to change default casing he would need to do it in two places, and that's rather not what we want, so I'm leaning more towards one rule for both cases.

mysticatea commented 6 years ago

I agree with you.

But I think that the name component-name-casing causes confusing between definition's and reference's.

How about component-definition-name-casing and component-reference-name-casing?

armano2 commented 6 years ago

@michalsnik, @mysticatea i can take this one.

i like one rule approach more to. but i'm not sure about name? component-definition-name-casing witch checks name property and Vue.component('***' seems good.

should i make old rule deprecated?

armano2 commented 4 years ago

646