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.
-
-
In practice that's really the exception. Most people call JSON.parse and perform ~zero runtime validation on it; they just want to tell the type system what the expected type is. That's equally unsound between 'any' vs downcasted 'unknown'
-
It's only the exception because it's hard to do without a validation library, deficiencies in TypeScript refinements, and there not being a strong culture for it
- 3 more replies
New conversation -
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 