Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 374e19e

Browse filesBrowse files
committed
fix(linter): false positive in react/jsx-curly-brace-presence (#10663)
fixes #9123
1 parent 5156822 commit 374e19e
Copy full SHA for 374e19e

File tree

Expand file treeCollapse file tree

1 file changed

+10
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-1
lines changed

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

Copy file name to clipboardExpand all lines: crates/oxc_linter/src/rules/react/jsx_curly_brace_presence.rs
+10-1Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,15 @@ impl JsxCurlyBracePresence {
464464
Expression::TemplateLiteral(template) => {
465465
if allowed.is_never() && template.is_no_substitution_template() {
466466
let string = template.quasi().unwrap();
467-
if is_allowed_string_like(ctx, string.as_str(), container, node.id(), is_prop) {
467+
if contains_quote_characters(string.as_str())
468+
|| is_allowed_string_like(
469+
ctx,
470+
string.as_str(),
471+
container,
472+
node.id(),
473+
is_prop,
474+
)
475+
{
468476
return;
469477
}
470478
report_unnecessary_curly(ctx, container, template.span);
@@ -822,6 +830,7 @@ fn test() {
822830
),
823831
("<App label={`${label}`} />", Some(json!(["never"]))),
824832
("<App>{`${label}`}</App>", Some(json!(["never"]))),
833+
(r#"<div>{`Nobody's "here"`}</div>"#, None),
825834
];
826835

827836
let fail = vec![

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.