{"record":{"id":"d53913f3c37b660a","repo":"oxc-project/oxc","slug":"curly-braces-are-unnecessary-here","errorCode":null,"errorMessage":"Curly braces are unnecessary here.","messagePattern":"Curly braces are unnecessary here\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/react/jsx_curly_brace_presence.rs","lineNumber":25,"sourceCode":"use oxc_allocator::ArenaVec;\n\nuse oxc_ast::{\n    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}","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/oxc-project/oxc/blob/1f902a69625cd14e6d8dc58feca94da099d2d251/crates/oxc_linter/src/rules/react/jsx_curly_brace_presence.rs#L7-L43","documentation":"Emitted by report_unnecessary_curly (and the attribute-value variant) in the react jsx-curly-brace-presence rule when a JSX expression container or attribute wraps something that needs no braces, such as a string literal in props or a trivial expression that renders identically without them.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/react/jsx_curly_brace_presence.rs:25 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the curly braces, e.g. prop=\"text\" instead of prop={\"text\"}","Unwrap trivial string/template expressions that are identical without braces","Configure propsIgnored or other rule options if certain braces are intentional"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1f902a69625cd14e6d8dc58feca94da099d2d251","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}