Skip to content

Commit bbb11f3

Browse files
committed
Improve lint warning wording
1 parent 204bbd4 commit bbb11f3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,25 +1705,25 @@ const tests = {
17051705
{
17061706
message:
17071707
'React Hook useEffect will crash when called with no arguments. ' +
1708-
'Did you forget to pass a function and an array of dependencies?',
1708+
'Did you forget to pass a callback to the hook?',
17091709
suggestions: undefined,
17101710
},
17111711
{
17121712
message:
17131713
'React Hook useLayoutEffect will crash when called with no arguments. ' +
1714-
'Did you forget to pass a function and an array of dependencies?',
1714+
'Did you forget to pass a callback to the hook?',
17151715
suggestions: undefined,
17161716
},
17171717
{
17181718
message:
17191719
'React Hook useCallback will crash when called with no arguments. ' +
1720-
'Did you forget to pass a function and an array of dependencies?',
1720+
'Did you forget to pass a callback to the hook?',
17211721
suggestions: undefined,
17221722
},
17231723
{
17241724
message:
17251725
'React Hook useMemo will crash when called with no arguments. ' +
1726-
'Did you forget to pass a function and an array of dependencies?',
1726+
'Did you forget to pass a callback to the hook?',
17271727
suggestions: undefined,
17281728
},
17291729
],

packages/eslint-plugin-react-hooks/src/ExhaustiveDeps.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ export default {
11271127
node: reactiveHook,
11281128
message:
11291129
`React Hook ${reactiveHookName} will crash when called with no arguments. ` +
1130-
`Did you forget to pass a function and an array of dependencies?`,
1130+
`Did you forget to pass a callback to the hook?`,
11311131
});
11321132
return;
11331133
}

0 commit comments

Comments
 (0)