-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Skip files with no-default-lib when '--skipDefaultLibCheck' are used #5511
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
Conversation
|
||
// If the user specified '--noLib' and a file has a '/// <reference no-default-lib="true"/>', | ||
// then we should treat that file as a default lib. | ||
if (compilerOptions.noLib && node.hasNoDefaultLib) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i do not think you need "compilerOptions.noLib" check. having a file with the NoDefaultLib comment is equivalent to --noLib.
I propose we simplify this whole thing, and remove sourceFile.isDefaultLib, as it is not clear why we have it. we should have one concept, is this file a default lib, and that is determined by the flag, the lib.d.ts we add has the flag anyways, so things should just work without the additional flag we are passing through.
we can change our test, to not include the /// comment. and just pass --noLib
instead, this way it still type checks, but does not trigger this condition.
@DanielRosenwasser can you update please. i think this is blocking @alexeagle |
No, not blocking, we have a workaround (return the ES5 stdlib from CompilerHost#getDefaultLibFilename) |
@mhegazy check out my recent changes. |
👍 |
…ultLib Skip files with no-default-lib when '--skipDefaultLibCheck' and '--noLib' are used
Addresses #5510.