vue/attribute-hyphenation
eslint-plugin-vue
Safe autofixRecommended
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/attribute-hyphenation": "error",
},
},
]; <MyComponent myProp="prop" />
</template> <MyComponent myProp="prop" />
</template> <MyComponent my-prop="prop" />
</template><MyComponent my-prop="prop" /><MyComponent my-prop="prop" /><MyComponent myProp="prop" />
<MyComponent data-id="prop" />
<MyComponent aria-role="button" />
<MyComponent slot-scope="prop" />Examples from the ESLint documentation.
vue/attribute-hyphenation
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/attribute-hyphenation": "error",
},
},
];Oxlint does not have this rule.
style/useVueHyphenatedAttributes
style · since 2.3.6
{
"linter": {
"rules": {
"style": {
"useVueHyphenatedAttributes": "error"
}
}
}
}Enforce specific casing for the Prop name in Vue components
Disallow variable declarations from shadowing variables declared in the outer scope
Enforce that each component should be in its own file
Require emits option with name triggered by $emit()