AAO-React-Native icon indicating copy to clipboard operation
AAO-React-Native copied to clipboard

Fix TypeScript errors and warnings

Open rye opened this issue 4 years ago • 7 comments

So now that we're successfully on typescript and using it, there are a number of errors and warnings to clean up so that we can eventually force all typescript errors to stop the build.

I've collected the error codes by count here. The fixes for each might be roughly the same, so that's why I am grouping these together.

  • [ ] 111: TS2322 (#5100)
  • [ ] 93: TS2339
  • [ ] 88: TS2345
  • [ ] 64: TS2709
  • [ ] 57: TS7006
  • [ ] 29: TS2769
  • [x] 25: TS7051 (#5390)
  • [ ] 18: TS7031
  • [ ] 18: TS2304
  • [ ] 14: TS2694
  • [ ] 14: TS2416
  • [ ] 11: TS2307
  • [ ] 10: TS7016
  • [x] 10: TS1064 (#5399)
  • [ ] 9: TS2741
  • [ ] 9: TS2531
  • [ ] 8: TS2740
  • [ ] 7: TS2614
  • [ ] 7: TS2532
  • [ ] 6: TS8020
  • [ ] 6: TS2554
  • [ ] 6: TS2300
  • [ ] 5: TS7053
  • [ ] 5: TS2707
  • [ ] 5: TS2540
  • [ ] 4: TS2739
  • [ ] 3: TS2786
  • [ ] 3: TS2588
  • [ ] 3: TS2559
  • [ ] 3: TS1336
  • [ ] 3: TS1205
  • [x] 3: TS1015 (#5401)
  • [ ] 2: TS7034
  • [ ] 2: TS7005
  • [ ] 2: TS2783
  • [ ] 2: TS2724
  • [ ] 2: TS2613
  • [ ] 2: TS2503
  • [x] 2: TS1361 (#5400)
  • [ ] 2: TS1337
  • [ ] 1: TS7019
  • [ ] 1: TS2749
  • [ ] 1: TS2698
  • [x] 1: TS2571 (#5391)
  • [ ] 1: TS2564
  • [x] 1: TS2459 (#5389)
  • [x] 1: TS2409 (#5465)
  • [x] 1: TS1208 (#5388)

rye avatar Apr 07 '21 01:04 rye

@rye thoughts on this issue?

drewvolz avatar Apr 20 '22 04:04 drewvolz

I should update the counts. We still have outstanding TypeScript errors and warnings, I thought, so ideally we could just use this for tracking.

rye avatar Apr 20 '22 11:04 rye

If you have a script for it, I was thinking that we could commit the results of this (and the results of the error diff) to master, so we'd automatically see them in our PRs (if we remember to run them, which I think the three of us would).

hawkrives avatar Apr 20 '22 14:04 hawkrives

Well, the "script" here is just a pretty straightforward pipeline:

> npx tsc | rg -or '$1' 'error (TS\d{4})' | sort | uniq -c | sort -nr
     45 TS2339
     20 TS2307
     19 TS7006
     18 TS2740
     16 TS2322
     14 TS2769
     12 TS7031
     12 TS2345
     10 TS7016
      7 TS2614
      6 TS2554
      4 TS2416
      3 TS7053
      3 TS2783
      3 TS2739
      3 TS2571
      2 TS2613
      2 TS2503
      2 TS2305
      2 TS2304
      2 TS1205
      1 TS2786
      1 TS2698
      1 TS2694
      1 TS2531
      1 TS1337
      1 TS1208

As far as output — do you mean the full output of tsc? That way we would essentially get the npx tsc diffs for free.

rye avatar Apr 20 '22 23:04 rye

Yep, that's what I was thinking. I'll write up some stuff in the Makefile, and we can start watching those diffs in git!

hawkrives avatar Apr 20 '22 23:04 hawkrives

See #5961 for a PR wth the output of the two scripts

hawkrives avatar Apr 21 '22 06:04 hawkrives

Updated list of counts

> make tsc-counts
     20 TS2345
     11 TS2322
     4 TS2307
     2 TS2769
     2 TS2339
     1 TS7053
     1 TS7016
     1 TS2571
     1 TS2304

drewvolz avatar Nov 12 '22 01:11 drewvolz

@rye I think this can be closed??

hawkrives avatar Jan 21 '23 04:01 hawkrives

I guess so!

rye avatar Jan 22 '23 16:01 rye