performant-software / chronicleME

“The Chronicle of Matthew of Edessa” (ChronicleME) online digital critical edition.
1 stars 0 forks source link

Resolve linter warnings about useEffect dependencies #137

Open blms opened 2 years ago

blms commented 2 years ago

ESLint raises the following warnings at compile time, mostly about functions in the useEffect dependency array.

./src/components/Edition/TextPane.js
  Line 200:8:  React Hook useEffect has missing dependencies: 'lookupManuscriptName', 'parserOptions', 'reading', and 'sectionId'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

./src/components/Edition/SvgGraph.js
  Line 27:8:  React Hook useEffect has a missing dependency: 'highlightAndSelect'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  Line 43:8:  React Hook useEffect has a missing dependency: 'highlightAndSelect'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  Line 51:8:  React Hook useEffect has a missing dependency: 'highlightAndSelect'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

./src/utils/Viewport.js
  Line 28:8:  React Hook useEffect has missing dependencies: 'getSize' and 'isClient'. Either include them or remove the dependency array  react-hooks/exhaustive-deps

./src/components/Routes.js
  Line 44:8:  React Hook useEffect has a missing dependency: 'translationIndex'. Either include it or remove the dependency array              react-hooks/exhaustive-deps
  Line 51:8:  React Hook useEffect has a missing dependency: 'translationDictionary.length'. Either include it or remove the dependency array  react-hooks/exhaustive-deps
  Line 57:8:  React Hook useEffect has a missing dependency: 'armenianIndex'. Either include it or remove the dependency array                 react-hooks/exhaustive-deps
  Line 63:8:  React Hook useEffect has a missing dependency: 'armenianDictionary.length'. Either include it or remove the dependency array     react-hooks/exhaustive-deps
  Line 71:8:  React Hook useEffect has a missing dependency: 'mapFeatures.length'. Either include it or remove the dependency array            react-hooks/exhaustive-deps
  Line 79:8:  React Hook useEffect has a missing dependency: 'locationLookup.length'. Either include it or remove the dependency array         react-hooks/exhaustive-deps
  Line 87:8:  React Hook useEffect has a missing dependency: 'timelineDates.length'. Either include it or remove the dependency array          react-hooks/exhaustive-deps

./src/components/Edition/SearchResults.js
  Line 86:8:  React Hook useEffect has missing dependencies: 'armenianDictionary', 'armenianIndex', 'groupSearchResults', 'translationDictionary', and 'translationIndex'. Either include them or remove the dependency array. If 'setDataDictionary' needs the current value of 'translationDictionary', you can also switch to useReducer instead of useState and read 'translationDictionary' in the reducer  react-hooks/exhaustive-deps