From 793ef9b8553ca029fa10958137b001d3081ae18f Mon Sep 17 00:00:00 2001 From: Redmond Tran Date: Thu, 25 Apr 2019 04:15:29 -0700 Subject: [PATCH] test(eslint-plugin-react-hooks): add coverage for unused custom hook (#15130) --- .../__tests__/ESLintRuleExhaustiveDeps-test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js b/packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js index e2018edf2dd96..8abfe2c9f862c 100644 --- a/packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js +++ b/packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js @@ -269,6 +269,16 @@ const tests = { `, options: [{additionalHooks: 'useCustomEffect'}], }, + { + code: ` + function MyComponent(props) { + useCustomEffect(() => { + console.log(props.foo); + }, []); + } + `, + options: [{additionalHooks: 'useAnotherEffect'}], + }, { // Valid because we don't care about hooks outside of components. code: `