Skip to content

Commit d5767cd

Browse files
committed
Reword missing effect callback message
1 parent bbb11f3 commit d5767cd

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
@@ -1704,25 +1704,25 @@ const tests = {
17041704
errors: [
17051705
{
17061706
message:
1707-
'React Hook useEffect will crash when called with no arguments. ' +
1707+
'React Hook useEffect requires an effect callback. ' +
17081708
'Did you forget to pass a callback to the hook?',
17091709
suggestions: undefined,
17101710
},
17111711
{
17121712
message:
1713-
'React Hook useLayoutEffect will crash when called with no arguments. ' +
1713+
'React Hook useLayoutEffect requires an effect callback. ' +
17141714
'Did you forget to pass a callback to the hook?',
17151715
suggestions: undefined,
17161716
},
17171717
{
17181718
message:
1719-
'React Hook useCallback will crash when called with no arguments. ' +
1719+
'React Hook useCallback requires an effect callback. ' +
17201720
'Did you forget to pass a callback to the hook?',
17211721
suggestions: undefined,
17221722
},
17231723
{
17241724
message:
1725-
'React Hook useMemo will crash when called with no arguments. ' +
1725+
'React Hook useMemo requires an effect callback. ' +
17261726
'Did you forget to pass a callback to the hook?',
17271727
suggestions: undefined,
17281728
},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ export default {
11261126
reportProblem({
11271127
node: reactiveHook,
11281128
message:
1129-
`React Hook ${reactiveHookName} will crash when called with no arguments. ` +
1129+
`React Hook ${reactiveHookName} requires an effect callback. ` +
11301130
`Did you forget to pass a callback to the hook?`,
11311131
});
11321132
return;

0 commit comments

Comments
 (0)