NoxHarmonium / peoples-choice

People's Choice is a web application that lets people vote for their colleagues
Apache License 2.0
2 stars 1 forks source link

Fix issues found by eslint-plugin-total-functions #19

Open NoxHarmonium opened 4 years ago

NoxHarmonium commented 4 years ago

https://github.com/NoxHarmonium/peoples-choice/pull/18 introduced the eslint-plugin-total-functions linting rule but the violations were ignored for now. We need to go through each place where the linting rule was ignored and see if we can make the access safer

danielnixon commented 3 years ago

TypeScript 4.1 (beta) now has a noUncheckedIndexedAccess flag so this issue can probably be solved by:

  1. Upgrade to TypeScript 4.1 (beta)
  2. Turn on noUncheckedIndexedAccess
  3. Upgrade eslint-plugin-total-functions
  4. Remove all eslint-disable-next-line total-functions/no-array-subscript comments
  5. Remove all eslint-disable-next-line total-functions/no-array-destructuring comments
  6. Fix (or ignore) any new issues identified by the latest version of eslint-plugin-total-functions