compiler option to fallback to unknown
instead of any
when failing to resolve a type
#46330
Open
5 tasks done
Labels
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
Suggestion
An idea for TypeScript
Uh oh!
There was an error while loading. Please reload this page.
Suggestion
π Search Terms
unknown instead of any error
β Viability Checklist
My suggestion meets these guidelines:
β Suggestion
currently, when a type fails to resolve, there's an error in an external lib suppressed by
skipLibCheck
, or an error suppressed by@ts-expect-error
/@ts-ignore
, the type falls back toany
it would be nice if there was a compiler option that changes this behavior to
unknown
instead ofany
. it would make this feature even more useful tooπ Motivating Example
currently,
@ts-ignore
and@ts-expect-error
comments aren't exposed in.d.ts
files. one of the concerns with changing this functionality seems to be that it can result inany
leaking into the codebase (see #38628 (comment)).π» Use Cases
skipLibCheck
, for example if a lib was compiled using a different version of typescript which causes errors on the version you're using@ts-expect-error
The text was updated successfully, but these errors were encountered: