{"record":{"id":"2993d744df07deb9","repo":"oxc-project/oxc","slug":"prop-name-should-define-at-least-its-type","errorCode":null,"errorMessage":"Prop \"{name}\" should define at least its type.","messagePattern":"Prop \"(.+?)\" should define at least its type\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/vue/require_prop_types.rs","lineNumber":15,"sourceCode":"use oxc_ast::{\n    AstKind,\n    ast::{\n        ArrayExpression, CallExpression, ExportDefaultDeclaration, ExportDefaultDeclarationKind,\n        Expression, NewExpression, ObjectExpression, ObjectPropertyKind,\n    },\n};\nuse oxc_diagnostics::OxcDiagnostic;\nuse oxc_macros::declare_oxc_lint;\nuse oxc_span::{GetSpan, Span};\n\nuse crate::{AstNode, context::LintContext, frameworks::FrameworkOptions, rule::Rule};\n\nfn require_type_diagnostic(span: Span, name: &str) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\"Prop \\\"{name}\\\" should define at least its type.\"))\n        .with_label(span)\n}\n\n#[derive(Debug, Default, Clone)]\npub struct RequirePropTypes;\n\ndeclare_oxc_lint!(\n    /// ### What it does\n    ///\n    /// This rule enforces that a props statement contains a type definition.\n    ///\n    /// ### Why is this bad?\n    ///\n    /// In committed code, prop definitions should always be as detailed as\n    /// possible, specifying at least type(s).\n    ///\n    /// ### Examples\n    ///","sourceCodeStart":1,"sourceCodeEnd":33,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/vue/require_prop_types.rs#L1-L33","documentation":"Emitted by check_define_model, check_props, and check_array_props in the vue require-prop-types rule when a prop is declared without any type information — as a bare key in an array or an object entry lacking a type field. It is a validation guard: untyped props skip Vue's runtime validation and make components harder to reason about.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/vue/require_prop_types.rs:15 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a type to the prop, e.g. props: { foo: { type: String, required: true } }","Give array-syntax props object entries with a type field","In type-based defineProps, annotate the prop's type instead of using unknown/any"],"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-14T05:17:10.506Z"}