TypeProps
TypeProps copied to clipboard
Replace any with unknown/never where needed
any is a type that should only be used in places where we want to turn off strict typing. In most cases, you want to either use never as a bottom type or type unknown = {} | null | undefined as a top type. I'm not sure yet whether to use an alias (as every other library also defines that same alias, or just use the longer union of three types, but be more clear about what we're doing.
Depends on Microsoft/TypeScript#10715
There are issues with {} | null | undefined. Luckily it seems like that issue has a lot of traction.
https://github.com/Microsoft/TypeScript/pull/24439
It's coming