I'm shocked at how often I run into problems due to TypeScript's generous usage of `any` in the standard library definitions. `unknown` is much more appropriate. The promotion of escaping type safety in such a fundamental place is worrying.
-
-
Adding downcasts don't produce soundness, it just shifts blame
-
I'm not particularly well versed in proper type system terminology. Where there is any, it produces uncertainness in my code which is why I use a type system in the first place. With proper refinements dealing with unknown is easy and I would prefer extra validation code anyway.
- 5 more replies
New conversation -
-
-
Is it possible to overwrite the stdlib? Seems like they should have stricter versions for “strict config” that would be straight forward to maintain
-
Yeah it's possible, same with Flow too. Maintaining a separate set of types seems painful, although a simple `any -> unknown` would be easy.
End of conversation
New conversation -
-
-
I find `Object`/`object` the worst among the mentioned
#typescript types. Most people know `any` is both ways compatible with everything (except for never, void, etc). But very few people know that so is `Object` because of#javascript coercion.Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 