eslint-plugin-vue icon indicating copy to clipboard operation
eslint-plugin-vue copied to clipboard

attribute-hyphenation should apply to v-model:propName

Open catrope opened this issue 1 year ago • 3 comments

What rule do you want to change? attribute-hyphenation

Does this change cause the rule to produce more or fewer warnings? More

How will the change be implemented? (New option, new default behavior, etc.)? New default behavior

Please provide some example code that this change will affect:

<my-component
    v-model:selectedItem="..."
   defaultValue="..."
/>

What does the rule currently do for this code? It flags that the defaultValue prop is not hyphenated (should be default-value), but it does not flag the selectedItem prop.

What will the rule do after it's changed? In addition to complaining that defaultValue should be hyphenated (default-value), it will also complain that selectedItem should be hyphenated (v-model:selected-item)

Additional context If prop names should be hyphenated, then they should always be hyphenated, even when used with v-model.

catrope avatar Jul 18 '24 21:07 catrope

Duplicate of https://github.com/vuejs/eslint-plugin-vue/issues/2439.

waynzh avatar Jul 19 '24 01:07 waynzh

It's analogous to #2439 but it doesn't seem to be a duplicate? It's a similar issue, but in a different rule, and this aspect of it is not described in #2439 at all

catrope avatar Jul 19 '24 03:07 catrope

in a different rule

You're right. Got confused there😬

waynzh avatar Jul 19 '24 03:07 waynzh