vue/scoped-event-names
Recommend scoped event names using context:event format
Default severity: warning
Presets: nuxt, opinionated
Automatic fix: None; review the suggested change
Applies to: Vue SFC templates and blocks, with script context where the rule requires it
Options: No rule-specific options. Severity and preset selection are configurable.
Configuration (Vite+)
import { defineConfig } from "@vizejs/vite-plugin/vite-plus";
export default defineConfig({
lint: {
vize: {
"preset": "incremental",
"rules": {
"vue/scoped-event-names": "warn"
}
},
},
});
vp run lint
Bad
playAudio, pauseAudio, and reloadAudio encode their scope as camel-case suffixes rather than the rule's colon-separated event convention.
<template>
<AudioPlayer
@playAudio="play"
@pauseAudio="pause"
@reloadAudio="reload"
/>
</template>
Good
audio:play, audio:pause, and audio:reload share an explicit audio: scope. The emitting component must use the same names.
<template>
<AudioPlayer
@audio:play="play"
@audio:pause="pause"
@audio:reload="reload"
/>
</template>
Good avoids this rule's finding under the configuration above; other rules may still report diagnostics.