Skip to content

Commit c609afb

Browse files
committed
feat(vue3): force camelCase for props in template
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
1 parent 4d417a9 commit c609afb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/configs/vue3.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ export function vue3(options: ConfigOptions): Linter.Config[] {
2828
{
2929
files: GLOB_FILES_VUE,
3030
rules: {
31+
// Force camelCase in props/attrs for consistency with <script> and prevent tooling issues
32+
'vue/attribute-hyphenation': ['error', 'never'],
3133
// Force camelCase for custom event name definitions (recommended by Vue 3 documentation and consistent with JS)
3234
'vue/custom-event-name-casing': [
3335
'error',
@@ -37,9 +39,9 @@ export function vue3(options: ConfigOptions): Linter.Config[] {
3739
ignores: ['/^[a-z]+:[a-z]+$/iu'],
3840
},
3941
],
40-
// Also force camelCase for events in template for consistency with <script>
42+
// Force camelCase for events in template for consistency with <script>
4143
'vue/v-on-event-hyphenation': ['error', 'never', { autofix: true }],
42-
// Also for slots
44+
// Force camelCase for slot names.
4345
// Changing case is breaking for component users.
4446
// For libraries it may result in a breaking change. Warn to prevent unintended breaking change.
4547
// TODO: allow namespace:slotName format like in events

0 commit comments

Comments
 (0)