{"record":{"id":"4c391c1c4582cd85","repo":"oxc-project/oxc","slug":"model-definition-is-deprecated-you-may-use-the","errorCode":null,"errorMessage":"`model` definition is deprecated. You may use the Vue 3-compatible `modelValue`/`update:modelValue` though.","messagePattern":"`model` definition is deprecated\\. You may use the Vue 3-compatible `modelValue`/`update:modelValue` though\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"warning","filePath":"crates/oxc_linter/src/rules/vue/no_deprecated_model_definition.rs","lineNumber":25,"sourceCode":"    ast::{Expression, ObjectExpression, ObjectPropertyKind},\n};\nuse oxc_diagnostics::OxcDiagnostic;\nuse oxc_macros::declare_oxc_lint;\nuse oxc_span::Span;\n\nuse crate::{\n    AstNode,\n    context::LintContext,\n    rule::{DefaultRuleConfig, Rule},\n    utils::is_vue_component_options_object,\n};\n\nfn deprecated_model_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"`model` definition is deprecated.\").with_label(span)\n}\n\nfn vue3_compat_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\n        \"`model` definition is deprecated. You may use the Vue 3-compatible `modelValue`/`update:modelValue` though.\",\n    )\n    .with_label(span)\n}\n\n#[derive(Debug, Default, Clone, Serialize, Deserialize, JsonSchema)]\n#[serde(rename_all = \"camelCase\", default, deny_unknown_fields)]\nstruct NoDeprecatedModelDefinitionConfig {\n    /// Allow `model: { prop: 'modelValue', event: 'update:modelValue' }` (or\n    /// the kebab-case `model-value` variant) which is forwards-compatible with\n    /// Vue 3's `v-model`.\n    allow_vue3_compat: bool,\n}\n\n#[derive(Debug, Default, Clone, Deserialize, Serialize, JsonSchema)]\npub struct NoDeprecatedModelDefinition(NoDeprecatedModelDefinitionConfig);\n\ndeclare_oxc_lint!(","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/vue/no_deprecated_model_definition.rs#L7-L43","documentation":"Diagnostic from oxlint's vue/no-deprecated-model-definition rule (since oxlint 1.63.0), Vue 3-compat variant. It fires when allowVue3Compat: true is configured and a `model` option exists but does not match the exact forwards-compatible shape — model: { prop: 'modelValue', event: 'update:modelValue' } (kebab-case model-value accepted). The message points at the modelValue/update:modelValue alternative while still flagging the non-compat definition.","triggerScenarios":"Config sets \"vue/no-deprecated-model-definition\": [\"error\", { \"allowVue3Compat\": true }] and the component's model option uses a different prop/event pair, e.g. { prop: 'value', event: 'input' }.","commonSituations":"Teams adopting the compat escape hatch during staged migration but only partially renaming props; the remaining old-shaped model options get this softer diagnostic instead of the generic one.","solutions":["Reshape the option to the exact compat pair: model: { prop: 'modelValue', event: 'update:modelValue' }","Better: drop the model option and migrate fully to the modelValue prop with update:modelValue emits","Re-check the kebab-case variant if the template uses model-value"],"exampleFix":"// before\nmodel: {\n  prop: 'value',\n  event: 'input',\n},\n// after (compat shape)\nmodel: {\n  prop: 'modelValue',\n  event: 'update:modelValue',\n}","handlingStrategy":"validation","validationCode":"# verify compat shape: prop must be modelValue, event update:modelValue\ngrep -rnA3 \"model: *{\" --include='*.vue' src | grep -E \"prop:|event:\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat allowVue3Compat as a migration bridge only; plan to remove model options entirely","Cover custom v-model components with tests that assert the update:modelValue event"],"tags":["vue","oxlint","lint","v-model","vue3","migration","compat"],"backgroundTag":"vue-2-to-3-migration","analyzedSha":"e1e7af627c8843ab64044ed466b128fcc21a035b","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}