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.
This produces no errors with noImplicitAny even though `foo` has been refined to `Array<any>` ``` const foo: unknown = []; if (Array.isArray(foo)) { foo; } ```
-
-
Right; that originates in the standard library as well (from the definition of Array.isArray). So a hypothetical lib.unknown.d.ts would fix it. Just checking that there wasn't something weird happening with any built-in narrowings.
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 