ka-extension / ka-extension-ts

A browser extension for Khan Academy.
MIT License
19 stars 11 forks source link

Remove `any` type declarations #178

Closed lukekrikorian closed 5 years ago

lukekrikorian commented 5 years ago

This commit adds the tslint rule no-any and fixes all subsequent lint errors. There are a few lines on which tslint ignore is used, mostly in inevitable situations like defining types for the window.ace object.

MatthiasPortzel commented 5 years ago

I know you asked me to review this and it's like a week later, but the vote-error handling is actually pretty important. It fires when attempting to vote up your own program, or if you've hit the 10 votes/hour limit, or if you don't have 5,000 EPs. It saves us from having to check those conditions before-hand. I really don't want to get rid of it; the alternative, we just undo the vote silently, is not good from a UX perspective.

I just undid this removal while merging this commit into fix-class-hashes. I'm going to try to re-write it to not include the use of any, but if I can't figure that out, I'd much rather have it in a tslint:disable block than remove it entirely. Type checking isn't worth it if it causes us to lose features or functionality.