AAO-React-Native
                                
                                 AAO-React-Native copied to clipboard
                                
                                    AAO-React-Native copied to clipboard
                            
                            
                            
                        Fix TypeScript errors and warnings
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 thoughts on this issue?
I should update the counts. We still have outstanding TypeScript errors and warnings, I thought, so ideally we could just use this for tracking.
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).
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.
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!
See #5961 for a PR wth the output of the two scripts
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
@rye I think this can be closed??
I guess so!