Skip to content

Commit 793ef9b

Browse files
RedTncpojer
authored andcommitted
test(eslint-plugin-react-hooks): add coverage for unused custom hook (#15130)
1 parent d61da93 commit 793ef9b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,16 @@ const tests = {
269269
`,
270270
options: [{additionalHooks: 'useCustomEffect'}],
271271
},
272+
{
273+
code: `
274+
function MyComponent(props) {
275+
useCustomEffect(() => {
276+
console.log(props.foo);
277+
}, []);
278+
}
279+
`,
280+
options: [{additionalHooks: 'useAnotherEffect'}],
281+
},
272282
{
273283
// Valid because we don't care about hooks outside of components.
274284
code: `

0 commit comments

Comments
 (0)