vue/v-on-event-hyphenation
eslint-plugin-vue
Safe autofixRecommended
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/v-on-event-hyphenation": "error",
},
},
]; <MyComponent v-on:customEvent="handleEvent" />
<MyComponent @customEvent="handleEvent" />
</template> <MyComponent v-on:customEvent="handleEvent" />
</template> <MyComponent v-on:custom-event="handleEvent" />
</template><MyComponent v-on:custom-event="handleEvent" />
<MyComponent @custom-event="handleEvent" /><MyComponent v-on:custom-event="handleEvent" /><MyComponent v-on:customEvent="handleEvent" />Examples from the ESLint documentation.
vue/v-on-event-hyphenation
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/v-on-event-hyphenation": "error",
},
},
];Oxlint does not have this rule.
nursery/useVueConsistentEventHyphenation
nursery · since 2.6.0
{
"linter": {
"rules": {
"nursery": {
"useVueConsistentEventHyphenation": "error"
}
}
}
}Enforce specific casing for component definition name
Disallow use computed property like method
Disallow registering components that are not used inside templates