Closed Bug 1849880 Opened 2 years ago Closed 2 years ago

Home.jsx: ESLint warning 'React Hook useEffect has missing dependencies'

Categories

(Firefox :: Pocket, task)

task

Tracking

()

RESOLVED FIXED
119 Branch
Tracking Status
firefox119 --- fixed

People

(Reporter: standard8, Assigned: thecount)

References

Details

Attachments

(1 file)

Running ESLint with warnings on browser/components/pocket/content/panels/js/components/Home/Home.jsx is currently giving a warning:

$ ./mach eslint --warnings browser/components/pocket/content/panels/js/components/Home/Home.jsx
browser/components/pocket/content/panels/js/components/Home/Home.jsx
  71:6  warning  React Hook useEffect has missing dependencies: 'articles' and 'hideRecentSaves'. Either include them or remove the dependency array.  react-hooks/exhaustive-deps (eslint)

It looks like this code was added in bug 1797595.

I don't know enough about the code to know if these should be added, or if this rule should be ignored. Scott, could you take a look please?

Overall I'd like to change the rule from a warning to an error, since warnings tend to get ignored and never resolved.

Flags: needinfo?(sdowne)
Assignee: nobody → sdowne
Flags: needinfo?(sdowne)
Pushed by sdowne@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d0f462441a05 Save to Pocket fixing eslint dependencies warning around useEffect. r=gvn
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch
Blocks: 1851452
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: