Skip to content

Commit b0e3e08

Browse files
committed
fix(linter): misplaced quote in jsx-curly-brace-presence test case (#11546)
1 parent a833ed1 commit b0e3e08

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

crates/oxc_linter/src/rules/react/jsx_curly_brace_presence.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -915,12 +915,12 @@ fn test() {
915915
(r#"<App>{"foo 'bar'"}</App>"#, Some(json!([{ "children": "never" }]))),
916916
(
917917
r#"
918-
<App prop=""#,
918+
<App prop="" />"#,
919919
Some(json!(["always"])),
920920
),
921921
(
922922
"
923-
<App prop='",
923+
<App prop='' />",
924924
Some(json!(["always"])),
925925
),
926926
(
@@ -1186,9 +1186,9 @@ fn test() {
11861186
),
11871187
(
11881188
r#"
1189-
<App prop=""#,
1189+
<App prop="" />"#,
11901190
r#"
1191-
<App prop=""#,
1191+
<App prop="" />"#,
11921192
Some(json!(["always"])),
11931193
),
11941194
(

crates/oxc_linter/src/snapshots/react_jsx_curly_brace_presence.snap

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -315,19 +315,23 @@ source: crates/oxc_linter/src/tester.rs
315315
· ───────────
316316
╰────
317317

318-
× Unterminated string
318+
eslint-plugin-react(jsx-curly-brace-presence): Curly braces are required here.
319319
╭─[jsx_curly_brace_presence.tsx:2:22]
320320
1
321-
2<App prop="
322-
·
321+
2<App prop="" />
322+
· ─┬
323+
· ╰── Wrap this value in curly braces
323324
╰────
325+
help: Wrap this value in curly braces
324326

325-
× Unterminated string
327+
eslint-plugin-react(jsx-curly-brace-presence): Curly braces are required here.
326328
╭─[jsx_curly_brace_presence.tsx:2:22]
327329
1
328-
2<App prop='
329-
·
330+
2<App prop='' />
331+
· ─┬
332+
· ╰── Wrap this value in curly braces
330333
╰────
334+
help: Wrap this value in curly braces
331335

332336
eslint-plugin-react(jsx-curly-brace-presence): Curly braces are required here.
333337
╭─[jsx_curly_brace_presence.tsx:4:19]

0 commit comments

Comments
 (0)