-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Don't let the declaration file break compilation #32908
Comments
This would mean misspelled type names would resolve to |
@DanielRosenwasser I think #31894 is not for this case , I think Typescipt should distinguish between source file and declaration file . source file can not have error , but declaration file can be tread like js (as long as it won't contains syntext error) |
@DanielRosenwasser I added a demo to show how this happend , it does not happend in your own source code , it happend when multiple declarion library been merge to your project. |
Have you tried |
@fatcerberus cool, it solve my problem 😜 . Thanks. |
Suggestion
Don't let the declaration file break compilation.
if you write a declaration file that use
--nolib
, and others has duplicate global class name,or a package depends on package depA, then package depA interface name has been renamed , then your app won't compile.
The unknowed type in .d.ts should map to
any
, and show a warning instead of errorUse Cases
@types/libraryA
from npm :and
@types/libraryB
from npm///<reference lib="dom" />
I create a git repo to show how this happend, and I can not find a way to solve the problem in your own source code.
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: