bcgov / cas-ggircs

Climate Action Secretariat's Greenhouse Gas Industrial Reporting and Control System
Apache License 2.0
3 stars 4 forks source link

Fix eslint errors: no-shadow & rules-of-hooks #398

Open dleard opened 2 years ago

dleard commented 2 years ago

In upgrading to Next 11, the esLint config was also updated, which has triggered some errors that need to be fixed. @typescript-eslint/no-shadow and react-hooks/rules-of-hooks have been set to warn for now.

Remove the override from error to warn in the eslintrc file for these rules & fix the errors.

https://reactjs.org/docs/hooks-rules.html https://typeofnan.dev/fix-the-react-hook-is-called-conditionally-error-in-react/

LindsayMacfarlane commented 1 year ago

Hi @dleard - what's the priority on this ticket? Is this something that still needs completing?

dleard commented 1 year ago

This is another code-quality gate. I would say it is low priority but could be flagged as something for us to talk about during our developer agreements meeting. (I think the 'no-shadow' rule in particular causes debate among developers). Lets leave the attn: developer tag on this for visibility