Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require JSX event handler names to follow conventions (react/jsx-handler-names) #1371

Closed
feross opened this issue Aug 15, 2019 · 1 comment
Closed

Comments

@feross
Copy link
Member

feross commented Aug 15, 2019

https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-handler-names.md

Ensures that any component or prop methods used to handle events are correctly prefixed.

Rule Details

The following patterns are considered warnings:

<MyComponent handleChange={this.handleChange} />
<MyComponent onChange={this.componentChanged} />

The following patterns are not considered warnings:

<MyComponent onChange={this.handleChange} />
<MyComponent onChange={this.props.onFoo} />

Here's an example of the diff that I applied to bitmidi.com in order to comply with this rule: feross/bitmidi.com@67ed076

@feross
Copy link
Member Author

feross commented Aug 15, 2019

Shipping in standard 14.

@feross feross closed this as completed in 5dfdc83 Aug 15, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2021
suchitg8 pushed a commit to suchitg8/standard that referenced this issue Apr 9, 2022
kaiwang0119 added a commit to kaiwang0119/standard that referenced this issue Aug 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

No branches or pull requests

1 participant