TSM-92: enable noImplicitAny and harden typing - #576
TSM-92: enable noImplicitAny and harden typing#576Justin Hammond (Justintime50) wants to merge 121 commits into
Conversation
a662c4b to
6714bfd
Compare
e44ffa2 to
66dc49d
Compare
6714bfd to
53fedf1
Compare
d47bde3 to
9a62d5e
Compare
36d96c6 to
0789212
Compare
9a62d5e to
43b6b9e
Compare
Alex Matthews (ralexmatthews)
left a comment
There was a problem hiding this comment.
Hmmm... so this turns off noImplicitAny, but then it types a bunch of them as any anyway so we are not getting a lot of a wins of TS.
In some of these place where stuff could be anything, like in the response checkers or errors, I think we should prefer unknown. any uses honor-system checking, "Yes TS, I promise I checked that this should work". unknown has TS check that it will work as expected. Its more verbose in places but a lot more type safe.
You could also make the errors default to unknown with the tsconfig setting.
| const params = returnUrl | ||
| ? { return_url: returnUrl } | ||
| : (null as unknown as Record<string, unknown>); |
There was a problem hiding this comment.
Issue:
Huh. Thats not right...
| let classObject; | ||
| if (RESOURCES[response.object] !== undefined) { | ||
| classObject = new RESOURCES[response.object](); | ||
| const responseRecord = response as Record<string, any>; |
There was a problem hiding this comment.
suggestion:
We could use another type guard here to prevent the assertion
Summary
Validation