{"record":{"id":"6d801af069968c59","repo":"oxc-project/oxc","slug":"message","errorCode":null,"errorMessage":"{message}","messagePattern":"\\{message\\}","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/react/forbid_component_props.rs","lineNumber":24,"sourceCode":"use oxc_span::{GetSpan, Span};\nuse oxc_str::CompactStr;\nuse schemars::JsonSchema;\nuse serde::Deserialize;\n\nuse crate::utils::{get_jsx_element_name, is_react_component_name};\nuse crate::{\n    AstNode,\n    context::{ContextHost, LintContext},\n    rule::{DefaultRuleConfig, Rule},\n};\n\nfn forbid_component_props_diagnostic(\n    span: Span,\n    prop: &str,\n    message: Option<&str>,\n) -> OxcDiagnostic {\n    if let Some(message) = message {\n        return OxcDiagnostic::warn(message.to_string()).with_label(span);\n    }\n    OxcDiagnostic::warn(format!(\"Prop \\\"{prop}\\\" is forbidden on Components\")).with_label(span)\n}\n\n#[derive(Debug, Default, Clone)]\nstruct ForbidOption {\n    /// Whether this entry was defined via `propNamePattern` (glob) instead of `propName`.\n    is_pattern: bool,\n    allowed_for: Vec<CompactStr>,\n    allowed_for_patterns: Vec<CompactStr>,\n    disallowed_for: Vec<CompactStr>,\n    disallowed_for_patterns: Vec<CompactStr>,\n    message: Option<String>,\n}\n\nimpl ForbidOption {\n    fn is_forbidden(&self, tag_name: Option<&str>) -> bool {\n        let Some(tag) = tag_name else {","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/react/forbid_component_props.rs#L6-L42","documentation":"Custom-message variant of react/forbid-component-props: the diagnostic message comes entirely from the user-configured message for a forbidden prop. It fires when a React component uses a prop listed in the rule's forbid configuration.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/react/forbid_component_props.rs:24 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the forbidden prop from the component usage.","Replace it with an allowed alternative named in the rule configuration.","Update or remove the rule configuration if the prop should be permitted."],"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"}