- ⚙️ This rule is included in
"plugin:vue/strongly-recommended"
and"plugin:vue/recommended"
. - 🔧 The
--fix
option on the command line can automatically fix some of the problems reported by this rule.
Default casing is set to always
with ['data-', 'aria-', 'slot-scope']
set to be ignored
'vue/attribute-hyphenation': [2, 'always'|'never', { 'ignore': ['custom-prop'] }]
👍 Examples of correct code`:
<MyComponent my-prop="prop"/>
👎 Examples of incorrect code`:
<MyComponent myProp="prop"/>
[2, "never"]
- Don't use hyphenated name. (It errors on hyphens except data-
, aria-
and slot-scope-
.)
👍 Examples of correct code`:
<MyComponent myProp="prop"/>
👎 Examples of incorrect code`:
<MyComponent my-prop="prop"/>
👍 Examples of correct code`:
<MyComponent myProp="prop" custom-prop="foo" data-id="1"/>
👎 Examples of incorrect code`:
<MyComponent my-prop="prop" custom-prop="foo" data-id="1"/>