TypeProps icon indicating copy to clipboard operation
TypeProps copied to clipboard

Replace any with unknown/never where needed

Open SimonMeskens opened this issue 7 years ago • 2 comments

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.

SimonMeskens avatar Apr 29 '18 20:04 SimonMeskens

Depends on Microsoft/TypeScript#10715

There are issues with {} | null | undefined. Luckily it seems like that issue has a lot of traction.

SimonMeskens avatar May 03 '18 14:05 SimonMeskens

https://github.com/Microsoft/TypeScript/pull/24439

It's coming

SimonMeskens avatar May 30 '18 23:05 SimonMeskens