Skip to content

Commit cc7f088

Browse files
takujiCopilot
andauthored
feat(linter): add react/jsx-handler-names rule (#13079)
This PR adds the [react/jsx-handler-names](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-handler-names.md) rule. ## Dropped test cases Test cases where the bind-this operator `::` is used are dropped because the current oxc parser doesn't seem to understand it. For example, if you test the following code: ```tsx <TestComponent onChange={props::handleChange} /> ``` You'll get an output like this: ``` -------- source -------- <TestComponent onChange={props::handleChange} /> -------- error -------- × Expected `}` but found `:` ╭─[jsx_handler_names.tsx:1:31] 1 │ <TestComponent onChange={props::handleChange} /> · ┬ · ╰── `}` expected ╰──── ``` All the dropped test cases are in this commit: d80dcfa works towards #1022 --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent d80c07c commit cc7f088

File tree

3 files changed

+771
-0
lines changed

3 files changed

+771
-0
lines changed

crates/oxc_linter/src/rules.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ mod react {
339339
pub mod jsx_curly_brace_presence;
340340
pub mod jsx_filename_extension;
341341
pub mod jsx_fragments;
342+
pub mod jsx_handler_names;
342343
pub mod jsx_key;
343344
pub mod jsx_no_comment_textnodes;
344345
pub mod jsx_no_duplicate_props;
@@ -967,6 +968,7 @@ oxc_macros::declare_all_lint_rules! {
967968
react::jsx_filename_extension,
968969
react::jsx_boolean_value,
969970
react::jsx_curly_brace_presence,
971+
react::jsx_handler_names,
970972
react::jsx_key,
971973
react::jsx_no_comment_textnodes,
972974
react::jsx_no_duplicate_props,

0 commit comments

Comments
 (0)