vue/custom-event-name-casing
eslint-plugin-vue
No autofix
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/custom-event-name-casing": "error",
},
},
]; <button @click="$emit('my-event')" />
</template>
<script>
export default {
methods: {
onClick() {
/* ✓ GOOD */
this.$emit('myEvent')
this.$emit('update:myProp', myProp)
/* ✗ BAD */
this.$emit('my-event')
}
}
}
</script> <button @click="$emit('myEvent')" />
</template>
<script>
export default {
methods: {
onClick() {
/* ✓ GOOD */
this.$emit('my-event')
/* ✗ BAD */
this.$emit('myEvent')
}
}
}
</script> <button @click="$emit('my-event')" />
</template>
<script>
export default {
methods: {
onClick() {
/* ✓ GOOD */
this.$emit('myEvent')
/* ✗ BAD */
this.$emit('my-event')
}
}
}
</script><button @click="$emit('myEvent')" /><button @click="$emit('my-event')" /><button @click="$emit('myEvent')" />Examples from the ESLint documentation.
vue/custom-event-name-casing
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/custom-event-name-casing": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Enforce specific casing for the component naming style in template
Enforce consistent newlines before and after dots in <template>
Enforce unified spacing in HTML comments
Enforce consistent spacing before and after commas in <template>
Enforce consistent spacing between keys and values in object literal properties in <template>