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

chore: set checkLocalVariables to true on jsx-handler-names rules #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion __snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2237,7 +2237,16 @@ exports[`should pass on packages/eslint-config-react/test/samples/my-component/M

exports[`should pass on packages/eslint-config-react/test/samples/my-component/MyComponent.old.js 1`] = `Array []`;

exports[`should pass on packages/eslint-config-react/test/samples/my-component/MyComponent.test.js 1`] = `Array []`;
exports[`should pass on packages/eslint-config-react/test/samples/my-component/MyComponent.test.js 1`] = `
Array [
Object {
"column": 43,
"line": 4,
"rule": "react/jsx-handler-names",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error shouldn't happen as the function is anonymous.. I guess that's a deal breaker for now, see: jsx-eslint/eslint-plugin-react#2586

"severity": 2,
},
]
`;

exports[`should pass on packages/eslint-config-react-web-a11y/test/rules/jsx-a11y.js 1`] = `
Array [
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-config-react/lib/rules/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module.exports = {
'react/jsx-handler-names': ['error', {
eventHandlerPrefix: 'handle',
eventHandlerPropPrefix: 'on',
checkLocalVariables: true,
satazor marked this conversation as resolved.
Show resolved Hide resolved
}],
// Validate props indentation in JSX
'react/jsx-indent-props': ['error', 4],
Expand Down