From a82f985de1ce62b3cd1e976a04a9a94c6fb75808 Mon Sep 17 00:00:00 2001 From: Rui Monteiro Date: Thu, 26 Mar 2020 11:19:36 +0000 Subject: [PATCH] chore: set checkLocalVariables to true on jsx-handler-names rules --- __snapshots__/index.test.js.snap | 11 ++++++++++- packages/eslint-config-react/lib/rules/react.js | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/__snapshots__/index.test.js.snap b/__snapshots__/index.test.js.snap index 5346644..4372a49 100644 --- a/__snapshots__/index.test.js.snap +++ b/__snapshots__/index.test.js.snap @@ -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", + "severity": 2, + }, +] +`; exports[`should pass on packages/eslint-config-react-web-a11y/test/rules/jsx-a11y.js 1`] = ` Array [ diff --git a/packages/eslint-config-react/lib/rules/react.js b/packages/eslint-config-react/lib/rules/react.js index 56ede6f..7751be0 100644 --- a/packages/eslint-config-react/lib/rules/react.js +++ b/packages/eslint-config-react/lib/rules/react.js @@ -24,6 +24,7 @@ module.exports = { 'react/jsx-handler-names': ['error', { eventHandlerPrefix: 'handle', eventHandlerPropPrefix: 'on', + checkLocalVariables: true, }], // Validate props indentation in JSX 'react/jsx-indent-props': ['error', 4],