Last active
December 23, 2022 01:00
-
-
Save VladSez/44ebe3624c072de881becd7dd408dcf5 to your computer and use it in GitHub Desktop.
Ts quirk on “object”
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/typescript-eslint/typescript-eslint/issues/5947 | |
Don't use `{}` as a type. `{}` actually means "any non-nullish value". | |
- If you want a type meaning "any object", you probably want `object` instead. | |
- If you want a type meaning "any value", you probably want `unknown` instead. | |
- If you want a type meaning "empty object", you probably want `Record<string, never>` instead. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment