For documentation to be accurate, it must correspond to the code that is written. This task encompasses the work to verify the JSDocs are in synchronization with the code they document. There are _many_ explorations for why type checking is useful, however, given the precedent set by Wikimedia's Phan usage and WMDE's full TypeScript usage for Termbox, this task takes no effort to enumerate them.
Acceptance criteria
- Revise and add existing JSDoc typing as needed. Avoid ignoring errors but keep patches digestible.
- Add NPM test:types script and update test to invoke it. A bad type should block a Gerrit merge. (Edit: this ended up being a three letter command, tsc, which didn't seem worthy of adding an NPM script.)
- Consider writing a similar task for Popups (migration may take longer given the size of the JavaScript codebase and missing Redux state typing).
QA
No functional changes so no QA is necessary.
Additional notes
- Adding additional detail to JSDocs like descriptions for functions and their parameters is welcome but not required.
- Add type definitions where needed to avoid any usage.
- Consider adding WMDE to patch as they may have interest.