{"record":{"id":"f364be4ce5287506","repo":"oxc-project/oxc","slug":"value-must-be-omitted-for-false-attribute-attr","errorCode":null,"errorMessage":"Value must be omitted for `false` attribute {attr:?}","messagePattern":"Value must be omitted for `false` attribute (.+?)","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/react/jsx_boolean_value.rs","lineNumber":31,"sourceCode":"use crate::{\n    AstNode,\n    context::{ContextHost, LintContext},\n    rule::{Rule, TupleRuleConfig},\n    utils::get_prop_value,\n};\n\nfn boolean_value_diagnostic(attr: &str, span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\"Value must be omitted for boolean attribute {attr:?}\"))\n        .with_label(span)\n}\n\nfn boolean_value_always_diagnostic(attr: &str, span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\"Value must be set for boolean attribute {attr:?}\"))\n        .with_label(span)\n}\n\nfn boolean_value_undefined_false_diagnostic(attr: &str, span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\"Value must be omitted for `false` attribute {attr:?}\"))\n        .with_label(span)\n}\n\n#[derive(Debug, Default, Clone, JsonSchema, Deserialize, Serialize)]\n#[serde(rename_all = \"kebab-case\")]\npub enum EnforceBooleanAttribute {\n    /// All boolean attributes must have explicit values.\n    Always,\n    /// All boolean attributes must omit values that are set to `true`.\n    #[default]\n    Never,\n}\n\n#[derive(Debug, Default, Clone, JsonSchema, Deserialize, Serialize)]\n#[serde(rename_all = \"camelCase\", default, deny_unknown_fields)]\npub struct JsxBooleanValueOptions {\n    /// List of attribute names that should always have explicit boolean values.\n    /// Only necessary when main mode is `\"never\"`.","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/react/jsx_boolean_value.rs#L13-L49","documentation":"Raised by react/jsx-boolean-value in 'always-but-omit-undefined'-like modes when a boolean attribute is set to a falsey/undefined value explicitly (e.g. disabled={false} in a mode requiring omission).","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/react/jsx_boolean_value.rs:31 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Omit attributes whose value is false/undefined.","Keep explicit values only for truthy booleans per the configured mode."],"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"}