Skip to content

Commit 2b7ae4b

Browse files
committed
Rename "assignment" to "initialization"
1 parent eaa2aff commit 2b7ae4b

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

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

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7036,7 +7036,7 @@ const tests = {
70367036
{
70377037
message:
70387038
"The 'foo' object makes the dependencies of useMemo Hook (at line 4) change on every render. " +
7039-
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own " +
7039+
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own " +
70407040
'useMemo() Hook.',
70417041
suggestions: undefined,
70427042
},
@@ -7053,7 +7053,7 @@ const tests = {
70537053
{
70547054
message:
70557055
"The 'foo' array makes the dependencies of useMemo Hook (at line 4) change on every render. " +
7056-
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own " +
7056+
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own " +
70577057
'useMemo() Hook.',
70587058
suggestions: undefined,
70597059
},
@@ -7104,7 +7104,7 @@ const tests = {
71047104
{
71057105
message:
71067106
"The 'foo' class makes the dependencies of useMemo Hook (at line 4) change on every render. " +
7107-
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own " +
7107+
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own " +
71087108
'useMemo() Hook.',
71097109
suggestions: undefined,
71107110
},
@@ -7121,7 +7121,7 @@ const tests = {
71217121
{
71227122
message:
71237123
"The 'foo' conditional could make the dependencies of useMemo Hook (at line 4) change on every render. " +
7124-
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own " +
7124+
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own " +
71257125
'useMemo() Hook.',
71267126
suggestions: undefined,
71277127
},
@@ -7138,7 +7138,7 @@ const tests = {
71387138
{
71397139
message:
71407140
"The 'foo' logical expression could make the dependencies of useMemo Hook (at line 4) change on every render. " +
7141-
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own " +
7141+
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own " +
71427142
'useMemo() Hook.',
71437143
suggestions: undefined,
71447144
},
@@ -7155,7 +7155,7 @@ const tests = {
71557155
{
71567156
message:
71577157
"The 'foo' logical expression could make the dependencies of useMemo Hook (at line 4) change on every render. " +
7158-
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own " +
7158+
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own " +
71597159
'useMemo() Hook.',
71607160
suggestions: undefined,
71617161
},
@@ -7172,7 +7172,7 @@ const tests = {
71727172
{
71737173
message:
71747174
"The 'foo' logical expression could make the dependencies of useMemo Hook (at line 4) change on every render. " +
7175-
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own " +
7175+
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own " +
71767176
'useMemo() Hook.',
71777177
suggestions: undefined,
71787178
},
@@ -7189,7 +7189,7 @@ const tests = {
71897189
{
71907190
message:
71917191
"The 'foo' conditional could make the dependencies of useMemo Hook (at line 4) change on every render. " +
7192-
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own " +
7192+
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own " +
71937193
'useMemo() Hook.',
71947194
suggestions: undefined,
71957195
},
@@ -7206,7 +7206,7 @@ const tests = {
72067206
{
72077207
message:
72087208
"The 'foo' object makes the dependencies of useMemo Hook (at line 4) change on every render. " +
7209-
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own " +
7209+
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own " +
72107210
'useMemo() Hook.',
72117211
suggestions: undefined,
72127212
},
@@ -7223,7 +7223,7 @@ const tests = {
72237223
{
72247224
message:
72257225
"The 'foo' object makes the dependencies of useMemo Hook (at line 4) change on every render. " +
7226-
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own " +
7226+
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own " +
72277227
'useMemo() Hook.',
72287228
suggestions: undefined,
72297229
},
@@ -7242,7 +7242,7 @@ const tests = {
72427242
{
72437243
message:
72447244
"The 'foo' object makes the dependencies of useCallback Hook (at line 6) change on every render. " +
7245-
"Move it inside the useCallback callback. Alternatively, wrap the assignment of 'foo' in its own " +
7245+
"Move it inside the useCallback callback. Alternatively, wrap the initialization of 'foo' in its own " +
72467246
'useMemo() Hook.',
72477247
suggestions: undefined,
72487248
},
@@ -7261,7 +7261,7 @@ const tests = {
72617261
{
72627262
message:
72637263
"The 'foo' object makes the dependencies of useEffect Hook (at line 6) change on every render. " +
7264-
"Move it inside the useEffect callback. Alternatively, wrap the assignment of 'foo' in its own " +
7264+
"Move it inside the useEffect callback. Alternatively, wrap the initialization of 'foo' in its own " +
72657265
'useMemo() Hook.',
72667266
suggestions: undefined,
72677267
},
@@ -7280,7 +7280,7 @@ const tests = {
72807280
{
72817281
message:
72827282
"The 'foo' object makes the dependencies of useLayoutEffect Hook (at line 6) change on every render. " +
7283-
"Move it inside the useLayoutEffect callback. Alternatively, wrap the assignment of 'foo' in its own " +
7283+
"Move it inside the useLayoutEffect callback. Alternatively, wrap the initialization of 'foo' in its own " +
72847284
'useMemo() Hook.',
72857285
suggestions: undefined,
72867286
},
@@ -7303,7 +7303,7 @@ const tests = {
73037303
{
73047304
message:
73057305
"The 'foo' object makes the dependencies of useImperativeHandle Hook (at line 9) change on every render. " +
7306-
"Move it inside the useImperativeHandle callback. Alternatively, wrap the assignment of 'foo' in its own " +
7306+
"Move it inside the useImperativeHandle callback. Alternatively, wrap the initialization of 'foo' in its own " +
73077307
'useMemo() Hook.',
73087308
suggestions: undefined,
73097309
},
@@ -7322,7 +7322,7 @@ const tests = {
73227322
{
73237323
message:
73247324
"The 'foo' logical expression could make the dependencies of useEffect Hook (at line 6) change on every render. " +
7325-
"Move it inside the useEffect callback. Alternatively, wrap the assignment of 'foo' in its own " +
7325+
"Move it inside the useEffect callback. Alternatively, wrap the initialization of 'foo' in its own " +
73267326
'useMemo() Hook.',
73277327
suggestions: undefined,
73287328
},
@@ -7342,7 +7342,7 @@ const tests = {
73427342
{
73437343
message:
73447344
"The 'foo' object makes the dependencies of useMemo Hook (at line 7) change on every render. " +
7345-
"To fix this, wrap the assignment of 'foo' in its own useMemo() Hook.",
7345+
"To fix this, wrap the initialization of 'foo' in its own useMemo() Hook.",
73467346
suggestions: undefined,
73477347
},
73487348
],
@@ -7360,7 +7360,7 @@ const tests = {
73607360
{
73617361
message:
73627362
"The 'foo' JSX fragment makes the dependencies of useMemo Hook (at line 6) change on every render. " +
7363-
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own useMemo() Hook.",
7363+
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own useMemo() Hook.",
73647364
suggestions: undefined,
73657365
},
73667366
],
@@ -7378,7 +7378,7 @@ const tests = {
73787378
{
73797379
message:
73807380
"The 'foo' JSX element makes the dependencies of useMemo Hook (at line 6) change on every render. " +
7381-
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own useMemo() Hook.",
7381+
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own useMemo() Hook.",
73827382
suggestions: undefined,
73837383
},
73847384
],
@@ -7396,7 +7396,7 @@ const tests = {
73967396
{
73977397
message:
73987398
"The 'foo' assignment expression makes the dependencies of useMemo Hook (at line 6) change on every render. " +
7399-
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own useMemo() Hook.",
7399+
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own useMemo() Hook.",
74007400
suggestions: undefined,
74017401
},
74027402
],
@@ -7414,7 +7414,7 @@ const tests = {
74147414
{
74157415
message:
74167416
"The 'foo' object construction makes the dependencies of useMemo Hook (at line 6) change on every render. " +
7417-
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own useMemo() Hook.",
7417+
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own useMemo() Hook.",
74187418
suggestions: undefined,
74197419
},
74207420
],
@@ -7432,7 +7432,7 @@ const tests = {
74327432
{
74337433
message:
74347434
"The 'foo' object construction makes the dependencies of useMemo Hook (at line 6) change on every render. " +
7435-
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own useMemo() Hook.",
7435+
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own useMemo() Hook.",
74367436
suggestions: undefined,
74377437
},
74387438
],
@@ -7450,7 +7450,7 @@ const tests = {
74507450
{
74517451
message:
74527452
"The 'foo' regular expression makes the dependencies of useMemo Hook (at line 6) change on every render. " +
7453-
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own useMemo() Hook.",
7453+
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own useMemo() Hook.",
74547454
suggestions: undefined,
74557455
},
74567456
],
@@ -7468,7 +7468,7 @@ const tests = {
74687468
{
74697469
message:
74707470
"The 'foo' object makes the dependencies of useMemo Hook (at line 6) change on every render. " +
7471-
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own useMemo() Hook.",
7471+
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own useMemo() Hook.",
74727472
suggestions: undefined,
74737473
},
74747474
],
@@ -7486,7 +7486,7 @@ const tests = {
74867486
{
74877487
message:
74887488
"The 'Bar' class makes the dependencies of useMemo Hook (at line 6) change on every render. " +
7489-
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'Bar' in its own useMemo() Hook.",
7489+
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'Bar' in its own useMemo() Hook.",
74907490
suggestions: undefined,
74917491
},
74927492
],
@@ -7882,7 +7882,7 @@ const testsTypescript = {
78827882
{
78837883
message:
78847884
"The 'foo' object makes the dependencies of useMemo Hook (at line 6) change on every render. " +
7885-
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own useMemo() Hook.",
7885+
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own useMemo() Hook.",
78867886
suggestions: undefined,
78877887
},
78887888
],

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ export default {
858858
depType === 'function' ? 'useCallback' : 'useMemo';
859859

860860
const constructionType =
861-
depType === 'function' ? 'definition' : 'assignment';
861+
depType === 'function' ? 'definition' : 'initialization';
862862

863863
const defaultAdvice = `wrap the ${constructionType} of '${construction.name.name}' in its own ${wrapperHook}() Hook.`;
864864

0 commit comments

Comments
 (0)