Skip to content
This repository has been archived by the owner on Dec 7, 2024. It is now read-only.

Replace any with unknown/never where needed #6

Open
SimonMeskens opened this issue Apr 29, 2018 · 2 comments
Open

Replace any with unknown/never where needed #6

SimonMeskens opened this issue Apr 29, 2018 · 2 comments

Comments

@SimonMeskens
Copy link
Owner

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
Copy link
Owner Author

Depends on microsoft/TypeScript#10715

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

@SimonMeskens SimonMeskens changed the title Replace any with {} | null | undefined where needed Replace any with unknown/never where needed May 4, 2018
@SimonMeskens
Copy link
Owner Author

microsoft/TypeScript#24439

It's coming

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant