-
Notifications
You must be signed in to change notification settings - Fork 4
Labels
Description
Proposal
'vue/component-name-in-template-casing': ['error', 'PascalCase](β default, used)'vue/custom-event-name-casing': ['error', 'camelCase'](β default, used)'vue/slot-name-casing': ['error', 'camelCase'](β default, add the rule)'vue/attribute-hyphenation': ['error', 'never'](π₯ opposite, change)
Motivation
- Having different cases in template and script makes it harder to find prop usage with a simple search
- Different tooling handle
kebab-caseworse, for example, with the newv-bindshortcut syntax<Tag :foo-bar />fromfooBarproperty, with refactoring and etc. - After introducing
slot-name-casing, attributes are the only withkebab-case
Isn't it against Vue Style Guide?
Not really, now both styles are correct if consistent: https://vuejs.org/style-guide/rules-strongly-recommended.html#prop-name-casing
In addition, the Vue Style Guide is:
- Not permanent: just recently
<kebab-case>was the recommended default to component names in the template - Not consistent: PascalCase/camelCase for components, event, slots and kebab for props
- Sometimes slow to adapt: before supporting in-dom templates was more important than nowadays, Vue 3 Style Guide was in active development for a long time after the Vue 3 release
susnux