Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant