Closed
Description
Given the following configuration:
react/jsx-handler-names:
- error
- eventHandlerPrefix: '(handle|on|set)'
checkLocalVariables: true
The following code:
<Button onClick={() => setVisible(!visible)}>
{visible ? 'Hide' : 'Show'}
</Button>
fails linting with the following message:
Handler function for onClick prop key must begin with '(handle|on|set)' react/jsx-handler-names
We believe react/jsx-handler-names
should not trigger on arrow functions, because there is no way to address the handler naming violation without refactoring into a variable or similar (which, while probably valid, is another rule/problem).
Thoughts?