This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
Ban explicit use of unknown type #4332
Closed
jpike88
started this conversation in
Suggestions
Replies: 1 comment 1 reply
-
I don't see your point for the first example. The second one is more arguable. In some cases it represents a required escape hatch because the type could be too hard to express in TypeScript. By the way this could be a good thing to require an explicit comment to explain why we need that. We would like to have more feedbacks from other devs, and possibly if the usage of this pattern is frequent. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When Rome is capable of reading types...
Casting to unknown type is an escape hatch to allow you to 'force' one type to act as another.
It's just too dangerous from our point of view to allow for it, there should be a rule that just prevents using it altogether.
e.g.
Beta Was this translation helpful? Give feedback.
All reactions