-
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
Can't disable type definitions for one special library #17042
Comments
I hit a similar problem with the new weak type checking: The more strict checks are fine for code you have control over, but for third party libs it is a problem. Even if the author updates, the newer version may have breaking changes. Theoretically each third party dependency should be compiled using the compiler version specified by it, however this is impractical. A way to disable these type checks on a per library basis may be more realistic. |
The best solution would be the opposite of |
Have you tried |
|
This option would be awesome to avoid transitive definition files to "pollute" the "ambient" space. My case, for example, I want |
Have you tried path mapping (https://www.typescriptlang.org/docs/handbook/module-resolution.html) to map that path to a non-existant one? |
Thanks @RyanCavanaugh it worked indeed, nice workaround. Small gotcha, I had to make sure the file actually existed (I first tried with a fake file name) |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
Hi, @jraoult . I tried this but failed:
|
Hi @RyanCavanaugh , |
@k8w sure thing
So as I mentioned earlier you actually need the file (.sink.d.ts in this case) to exist. |
@jraoult @RyanCavanaugh |
for global declarations set |
@mhegazy |
@mhegazy but that's not what I want as I said before. |
TypeScript Version: 2.4.1
For example I want to consume a library from npm called
awesome-lib
. This library already ships with a TypeScript type definition but this one is outdated and buggy. The author of the library doesn't update this one.I've tried to disable that type definition completely in my own
declarations.d.ts
file in my project:Unfortunately TypeScript reads first the type definition in the library and throws some errors. So it is not possible for me to disable / hide this library for my project.
The text was updated successfully, but these errors were encountered: