Skip to content

Commit

Permalink
Rename "assignment" to "initialization"
Browse files Browse the repository at this point in the history
  • Loading branch information
captbaritone committed Aug 13, 2020
1 parent eaa2aff commit 2b7ae4b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7036,7 +7036,7 @@ const tests = {
{
message:
"The 'foo' object makes the dependencies of useMemo Hook (at line 4) change on every render. " +
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own " +
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own " +
'useMemo() Hook.',
suggestions: undefined,
},
Expand All @@ -7053,7 +7053,7 @@ const tests = {
{
message:
"The 'foo' array makes the dependencies of useMemo Hook (at line 4) change on every render. " +
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own " +
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own " +
'useMemo() Hook.',
suggestions: undefined,
},
Expand Down Expand Up @@ -7104,7 +7104,7 @@ const tests = {
{
message:
"The 'foo' class makes the dependencies of useMemo Hook (at line 4) change on every render. " +
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own " +
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own " +
'useMemo() Hook.',
suggestions: undefined,
},
Expand All @@ -7121,7 +7121,7 @@ const tests = {
{
message:
"The 'foo' conditional could make the dependencies of useMemo Hook (at line 4) change on every render. " +
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own " +
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own " +
'useMemo() Hook.',
suggestions: undefined,
},
Expand All @@ -7138,7 +7138,7 @@ const tests = {
{
message:
"The 'foo' logical expression could make the dependencies of useMemo Hook (at line 4) change on every render. " +
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own " +
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own " +
'useMemo() Hook.',
suggestions: undefined,
},
Expand All @@ -7155,7 +7155,7 @@ const tests = {
{
message:
"The 'foo' logical expression could make the dependencies of useMemo Hook (at line 4) change on every render. " +
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own " +
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own " +
'useMemo() Hook.',
suggestions: undefined,
},
Expand All @@ -7172,7 +7172,7 @@ const tests = {
{
message:
"The 'foo' logical expression could make the dependencies of useMemo Hook (at line 4) change on every render. " +
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own " +
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own " +
'useMemo() Hook.',
suggestions: undefined,
},
Expand All @@ -7189,7 +7189,7 @@ const tests = {
{
message:
"The 'foo' conditional could make the dependencies of useMemo Hook (at line 4) change on every render. " +
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own " +
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own " +
'useMemo() Hook.',
suggestions: undefined,
},
Expand All @@ -7206,7 +7206,7 @@ const tests = {
{
message:
"The 'foo' object makes the dependencies of useMemo Hook (at line 4) change on every render. " +
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own " +
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own " +
'useMemo() Hook.',
suggestions: undefined,
},
Expand All @@ -7223,7 +7223,7 @@ const tests = {
{
message:
"The 'foo' object makes the dependencies of useMemo Hook (at line 4) change on every render. " +
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own " +
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own " +
'useMemo() Hook.',
suggestions: undefined,
},
Expand All @@ -7242,7 +7242,7 @@ const tests = {
{
message:
"The 'foo' object makes the dependencies of useCallback Hook (at line 6) change on every render. " +
"Move it inside the useCallback callback. Alternatively, wrap the assignment of 'foo' in its own " +
"Move it inside the useCallback callback. Alternatively, wrap the initialization of 'foo' in its own " +
'useMemo() Hook.',
suggestions: undefined,
},
Expand All @@ -7261,7 +7261,7 @@ const tests = {
{
message:
"The 'foo' object makes the dependencies of useEffect Hook (at line 6) change on every render. " +
"Move it inside the useEffect callback. Alternatively, wrap the assignment of 'foo' in its own " +
"Move it inside the useEffect callback. Alternatively, wrap the initialization of 'foo' in its own " +
'useMemo() Hook.',
suggestions: undefined,
},
Expand All @@ -7280,7 +7280,7 @@ const tests = {
{
message:
"The 'foo' object makes the dependencies of useLayoutEffect Hook (at line 6) change on every render. " +
"Move it inside the useLayoutEffect callback. Alternatively, wrap the assignment of 'foo' in its own " +
"Move it inside the useLayoutEffect callback. Alternatively, wrap the initialization of 'foo' in its own " +
'useMemo() Hook.',
suggestions: undefined,
},
Expand All @@ -7303,7 +7303,7 @@ const tests = {
{
message:
"The 'foo' object makes the dependencies of useImperativeHandle Hook (at line 9) change on every render. " +
"Move it inside the useImperativeHandle callback. Alternatively, wrap the assignment of 'foo' in its own " +
"Move it inside the useImperativeHandle callback. Alternatively, wrap the initialization of 'foo' in its own " +
'useMemo() Hook.',
suggestions: undefined,
},
Expand All @@ -7322,7 +7322,7 @@ const tests = {
{
message:
"The 'foo' logical expression could make the dependencies of useEffect Hook (at line 6) change on every render. " +
"Move it inside the useEffect callback. Alternatively, wrap the assignment of 'foo' in its own " +
"Move it inside the useEffect callback. Alternatively, wrap the initialization of 'foo' in its own " +
'useMemo() Hook.',
suggestions: undefined,
},
Expand All @@ -7342,7 +7342,7 @@ const tests = {
{
message:
"The 'foo' object makes the dependencies of useMemo Hook (at line 7) change on every render. " +
"To fix this, wrap the assignment of 'foo' in its own useMemo() Hook.",
"To fix this, wrap the initialization of 'foo' in its own useMemo() Hook.",
suggestions: undefined,
},
],
Expand All @@ -7360,7 +7360,7 @@ const tests = {
{
message:
"The 'foo' JSX fragment makes the dependencies of useMemo Hook (at line 6) change on every render. " +
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own useMemo() Hook.",
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own useMemo() Hook.",
suggestions: undefined,
},
],
Expand All @@ -7378,7 +7378,7 @@ const tests = {
{
message:
"The 'foo' JSX element makes the dependencies of useMemo Hook (at line 6) change on every render. " +
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own useMemo() Hook.",
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own useMemo() Hook.",
suggestions: undefined,
},
],
Expand All @@ -7396,7 +7396,7 @@ const tests = {
{
message:
"The 'foo' assignment expression makes the dependencies of useMemo Hook (at line 6) change on every render. " +
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own useMemo() Hook.",
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own useMemo() Hook.",
suggestions: undefined,
},
],
Expand All @@ -7414,7 +7414,7 @@ const tests = {
{
message:
"The 'foo' object construction makes the dependencies of useMemo Hook (at line 6) change on every render. " +
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own useMemo() Hook.",
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own useMemo() Hook.",
suggestions: undefined,
},
],
Expand All @@ -7432,7 +7432,7 @@ const tests = {
{
message:
"The 'foo' object construction makes the dependencies of useMemo Hook (at line 6) change on every render. " +
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own useMemo() Hook.",
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own useMemo() Hook.",
suggestions: undefined,
},
],
Expand All @@ -7450,7 +7450,7 @@ const tests = {
{
message:
"The 'foo' regular expression makes the dependencies of useMemo Hook (at line 6) change on every render. " +
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own useMemo() Hook.",
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own useMemo() Hook.",
suggestions: undefined,
},
],
Expand All @@ -7468,7 +7468,7 @@ const tests = {
{
message:
"The 'foo' object makes the dependencies of useMemo Hook (at line 6) change on every render. " +
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own useMemo() Hook.",
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own useMemo() Hook.",
suggestions: undefined,
},
],
Expand All @@ -7486,7 +7486,7 @@ const tests = {
{
message:
"The 'Bar' class makes the dependencies of useMemo Hook (at line 6) change on every render. " +
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'Bar' in its own useMemo() Hook.",
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'Bar' in its own useMemo() Hook.",
suggestions: undefined,
},
],
Expand Down Expand Up @@ -7882,7 +7882,7 @@ const testsTypescript = {
{
message:
"The 'foo' object makes the dependencies of useMemo Hook (at line 6) change on every render. " +
"Move it inside the useMemo callback. Alternatively, wrap the assignment of 'foo' in its own useMemo() Hook.",
"Move it inside the useMemo callback. Alternatively, wrap the initialization of 'foo' in its own useMemo() Hook.",
suggestions: undefined,
},
],
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-react-hooks/src/ExhaustiveDeps.js
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ export default {
depType === 'function' ? 'useCallback' : 'useMemo';

const constructionType =
depType === 'function' ? 'definition' : 'assignment';
depType === 'function' ? 'definition' : 'initialization';

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

Expand Down

0 comments on commit 2b7ae4b

Please sign in to comment.