{"record":{"id":"01a17614613d9311","repo":"oxc-project/oxc","slug":"curly-braces-are-required-here","errorCode":null,"errorMessage":"Curly braces are required here.","messagePattern":"Curly braces are required here\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/react/jsx_curly_brace_presence.rs","lineNumber":28,"sourceCode":"    AstKind,\n    ast::{\n        Expression, JSXAttributeItem, JSXAttributeValue, JSXChild, JSXElementName, JSXExpression,\n        JSXExpressionContainer,\n    },\n};\nuse oxc_codegen::CodegenOptions;\nuse oxc_diagnostics::{LabeledSpan, OxcDiagnostic};\nuse oxc_macros::declare_oxc_lint;\nuse oxc_semantic::NodeId;\nuse oxc_span::{GetSpan as _, Span};\nuse schemars::JsonSchema;\nuse serde::{Deserialize, Serialize};\n\nfn jsx_curly_brace_presence_unnecessary_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Curly braces are unnecessary here.\").with_label(span)\n}\nfn jsx_curly_brace_presence_necessary_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Curly braces are required here.\")\n        .with_help(\"Wrap this value in curly braces\")\n        .with_labels([LabeledSpan::new_primary_with_span(\n            Some(\"Wrap this value in curly braces\".into()),\n            span,\n        )])\n}\n\n#[derive(Debug, Default, Clone, Copy, JsonSchema, Deserialize, Serialize)]\n#[serde(rename_all = \"kebab-case\")]\nenum JsxCurlyBracePresenceMode {\n    Always,\n    Never,\n    #[default]\n    Ignore,\n}\n\nimpl JsxCurlyBracePresenceMode {\n    pub fn is_never(self) -> bool {","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/oxc-project/oxc/blob/36ec0ef2bae567d1a8413ada2fe795f1af1f2785/crates/oxc_linter/src/rules/react/jsx_curly_brace_presence.rs#L10-L46","documentation":"Emitted by the missing-curly reporters of the react jsx-curly-brace-presence rule when a JSX expression or attribute requires braces under the configured style but has none — e.g. a string prop containing quotes or special characters that must be escaped, or an expression child written as bare text.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/react/jsx_curly_brace_presence.rs:28 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wrap the value in curly braces, e.g. prop={\"'quoted'\"} for strings containing quote characters","Adjust the rule's propValue/elem/attr options if the brace requirement is unwanted"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"36ec0ef2bae567d1a8413ada2fe795f1af1f2785","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}