Skip to content

vue-doctor/correctness/require-emits-declaration ​

Declare events with const emit = defineEmits<{ change: [value: string] }>() and call emit('change', value) instead of $emit

PropertyValue
CategoryCorrectness
Default Severitywarning
Confidencehigh
FixableNo
Engineoxlint
Sincev1.0.0
Frameworksvue, nuxt
Test filesNot checked (which files)

Why it matters ​

Declare events with const emit = defineEmits<{ change: [value: string] }>() and call emit('change', value) instead of $emit

How to fix ​

Review the finding and update the code according to best practices below.

Agent Guidance ​

Declare events with const emit = defineEmits<{ change: [value: string] }>() and call emit('change', value) instead of $emit.


Rule source: vue-doctor/correctness/require-emits-declaration

Released under the MIT License.