test(eslint-plugin-react-hooks): add coverage for unused custom hook (#15130)
Redmond Tran committed
Apr 25, 2019 at 04:15 UTC
793ef9b8553ca029fa10958137b001d3081ae18f
1 file changed
+10
packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js
+10
@@ -269,6 +269,16 @@ const tests = {
269
`,
270
options: [{additionalHooks: 'useCustomEffect'}],
271
},
272
+ {
273
+ code: `
274
+ function MyComponent(props) {
275
+ useCustomEffect(() => {
276
+ console.log(props.foo);
277
+ }, []);
278
+ }
279
+ `,
280
+ options: [{additionalHooks: 'useAnotherEffect'}],
281
+ },
282
{
283
// Valid because we don't care about hooks outside of components.
284
code: `