vue/v-on-event-hyphenation
enforce v-on event naming style on custom components in template
- ⚙️ This rule is included in all of
"plugin:vue/vue3-strongly-recommended"
,*.configs["flat/strongly-recommended"]
,"plugin:vue/vue3-recommended"
and*.configs["flat/recommended"]
. - 🔧 The
--fix
option on the command line can automatically fix some of the problems reported by this rule.
📖 Rule Details
This rule enforces using hyphenated v-on event names on custom components in Vue templates.
🔧 Options
json
{
"vue/v-on-event-hyphenation": ["error", "always" | "never", {
"autofix": false,
"ignore": []
}]
}
"always"
(default) ... Use hyphenated name."never"
... Don't use hyphenated name."ignore"
... Array of ignored names"autofix"
... Iftrue
, enable autofix. If you are using Vue 2, we recommend that you do not use it due to its side effects.
"always"
It errors on upper case letters.
"never"
It errors on hyphens.
"never", { "ignore": ["custom-event"] }
Don't use hyphenated name but allow custom event names
👫 Related Rules
📚 Further Reading
🚀 Version
This rule was introduced in eslint-plugin-vue v7.4.0