Skip to content

Commit b707b0a

Browse files
committed
remove "props.({prop_prefix_pattern})" from the handler name pattern
because the extracted handler name will not have the "props." part.
1 parent 3f006de commit b707b0a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,9 @@ fn build_event_handler_regex(handler_prefix: &str, handler_prop_prefix: &str) ->
142142
if prefix_pattern.is_empty() || prop_prefix_pattern.is_empty() {
143143
return None;
144144
}
145-
let regex = RegexBuilder::new(
146-
format!(r"^((props\.({prop_prefix_pattern}))|((.*\.)?({prefix_pattern})))[0-9]*[A-Z].*$")
147-
.as_str(),
148-
)
149-
.build()
150-
.expect("Failed to compile regex for event handler prefixes");
145+
let regex = RegexBuilder::new(format!(r"^((.*\.)?({prefix_pattern}))[0-9]*[A-Z].*$").as_str())
146+
.build()
147+
.expect("Failed to compile regex for event handler prefixes");
151148
Some(regex)
152149
}
153150

0 commit comments

Comments
 (0)