{"record":{"id":"e50429af1b0d1f6b","repo":"oxc-project/oxc","slug":"custom-events-are-not-defined","errorCode":null,"errorMessage":"Custom events are not defined.","messagePattern":"Custom events are not defined\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/vue/valid_define_emits.rs","lineNumber":29,"sourceCode":"};\n\nfn has_type_and_arguments_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"`defineEmits` has both a type-only emit and an argument.\")\n        .with_help(\"remove the argument for better type inference.\")\n        .with_label(span)\n}\n\nfn called_multiple_times(span: Span, second_span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"`defineEmits` has been called multiple times.\")\n        .with_help(\"combine all events into a single `defineEmits` call.\")\n        .with_labels([\n            span.label(\"`defineEmits` is called here\"),\n            second_span.label(\"`defineEmits` is called here too\"),\n        ])\n}\n\nfn events_not_defined(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Custom events are not defined.\")\n        .with_help(\"Define at least one event in `defineEmits`.\")\n        .with_label(span)\n}\n\nfn referencing_locally(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"`defineEmits` is referencing locally declared variables.\")\n        .with_help(\"inline the variable or import it from another module.\")\n        .with_label(span)\n}\n\nfn define_in_both(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Custom events are defined in both `defineEmits` and `export default {}`.\")\n        .with_help(\"Remove `export default`.\")\n        .with_label(span)\n}\n\n#[derive(Debug, Default, Clone)]\npub struct ValidDefineEmits;","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/vue/valid_define_emits.rs#L11-L47","documentation":"Emitted by run_once of the vue valid-define-emits rule when a defineEmits call declares an empty list/type — no custom events at all. It is a validation guard: an empty declaration is usually a mistake and typically should not exist.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/vue/valid_define_emits.rs:29 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Define at least one event in the defineEmits declaration","Remove the empty defineEmits call if the component emits no events"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e1e7af627c8843ab64044ed466b128fcc21a035b","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}