Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
🔓 Intent to use: checker.isTypeAssignableTo#7936
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
OverviewLong have we in the TypeScript tooling community spoken of this in hushed tones:microsoft/TypeScript#9879, using a typerelationship API in TypeScript. A typerelationship API would most notably let us determine reliably whether a type is assignable to another type. That ability would be fantastic for a slew of bugs and feature requests: seemicrosoft/TypeScript#9879 (comment) for a list of over a dozen in this repo alone. TypeScript hasn't yet exposed a type relationship API publicly out of concern for stability and whether the limited set of APIs we're requesting will be sufficient for most or all use cases. Which is very reasonable: the type checker is very complex and has lots of caching internally that can be difficult to predict without deep knowledge of TypeScript program implementations. It's a risky thing to expose these APIs and doubly risky to make them part of a versioned public API. But! Over the last few years, we've seen several community projects make use of the private Fun fact: |
BetaWas this translation helpful?Give feedback.
All reactions
👍 10❤️ 5
Replies: 2 comments
-
https://devblogs.microsoft.com/typescript/announcing-typescript-5-4-rc 🚀 Looks like we can consider |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
-
Now that typescript-eslint@v8 is released, this is ready to go! |
BetaWas this translation helpful?Give feedback.
All reactions
😄 1❤️ 3