Skip to content

Commit f08261d

Browse files
committed
fix(linter/switch-case-braces): add non-capturing group to regex
1 parent dfa5825 commit f08261d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/oxc_linter/src/rules/unicorn/switch_case_braces.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl Rule for SwitchCaseBraces {
105105
}
106106

107107
let switch_clause_regex =
108-
Regex::new(r#"(case|default)\s*(`[^`]+`|'[^']+'|"[^"]+"|[^:]*):"#).unwrap();
108+
Regex::new(r#"(?:case|default)\s*(?:`[^`]+`|'[^']+'|"[^"]+"|[^:]*):"#).unwrap();
109109

110110
for case in &switch.cases {
111111
if case.consequent.is_empty() {

0 commit comments

Comments
 (0)