Skip to content

Will jsx-handler-names provide suffixes ? #3585

Open
@leadq

Description

@leadq

I am very happy using this plugin. However, I think suffixes should be included in naming conventions.

For example, we are trying to implement a pattern like this in our project:

handle{subjectName}{eventName}

or "handle" is replaced by "on" depending on the situation.

valid outputs:
onSwitchChange, handleSwitchChange
handleChange,
onMove,
onMouseMove
handleMouseMove,
handleSomeComponentSubmit etc.

We cannot require the event name to be at the end in the current plugin. I did not see a request for this in the issues. Is it impossible to achieve this or do you have any future plans?

For example, we can manually specify the eventNames in the array ["Click", "Change",.... => maybe 20 more] or if you can easily give the eventNames by default, that would be much nicer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions