We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6043ccf commit d4a9191Copy full SHA for d4a9191
crates/oxc_linter/src/rules/react/jsx_handler_names.rs
@@ -369,7 +369,8 @@ fn get_member_expression_name(member_expr: &JSXMemberExpression) -> CompactStr {
369
370
fn normalize_handler_name(s: &str) -> CompactStr {
371
let s1 = regex!(r"\s*").replace_all(s, "");
372
- regex!(r"^this\.|\S*::").replace(s1.as_ref(), "").into()
+ // Combine whitespace removal and prefix stripping into a single regex operation.
373
+ regex!(r"\s+|^this\.|\S*::").replace_all(s, "").into()
374
}
375
376
// Tests for the normalize_handler_name function to ensure it correctly strips prefixes and whitespace.
0 commit comments