Ensures that any component or prop methods used to handle events are correctly prefixed.
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} />
...
"jsx-handler-names": [<enabled>, {
"eventHandlerPrefix": <eventHandlerPrefix>,
"eventHandlerPropPrefix": <eventHandlerPropPrefix>
}]
...
eventHandlerPrefix
: Prefix for component methods used as event handlers. Defaults tohandle
eventHandlerPropPrefix
: Prefix for props that are used as event handlers. Defaults toon
If you are not using JSX, or if you don't want to enforce specific naming conventions for event handlers.