diff --git a/crates/oxc_linter/src/rules/react/jsx_curly_brace_presence.rs b/crates/oxc_linter/src/rules/react/jsx_curly_brace_presence.rs index 449e6e9c4ddbc..52655f99f0082 100644 --- a/crates/oxc_linter/src/rules/react/jsx_curly_brace_presence.rs +++ b/crates/oxc_linter/src/rules/react/jsx_curly_brace_presence.rs @@ -495,7 +495,7 @@ fn is_allowed_string_like<'a>( || is_line_break(s) || contains_html_entity(s) || !is_prop && contains_disallowed_jsx_text_chars(s) - || s.trim() != s + || !is_prop && s.trim() != s || contains_multiline_comment(s) || contains_line_break_literal(s) || contains_utf8_escape(s) diff --git a/crates/oxc_linter/src/snapshots/react_jsx_curly_brace_presence.snap b/crates/oxc_linter/src/snapshots/react_jsx_curly_brace_presence.snap index 6ca2f63733f8e..0b341a7b6ab5b 100644 --- a/crates/oxc_linter/src/snapshots/react_jsx_curly_brace_presence.snap +++ b/crates/oxc_linter/src/snapshots/react_jsx_curly_brace_presence.snap @@ -255,6 +255,12 @@ source: crates/oxc_linter/src/tester.rs · ───── ╰──── + ⚠ eslint-plugin-react(jsx-curly-brace-presence): Curly braces are unnecessary here. + ╭─[jsx_curly_brace_presence.tsx:1:25] + 1 │ + · ─────── + ╰──── + ⚠ eslint-plugin-react(jsx-curly-brace-presence): Curly braces are required here. ╭─[jsx_curly_brace_presence.tsx:1:11] 1 │