Skip to content

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

Merged
merged 5 commits into from
Nov 9, 2015

Conversation

DanielRosenwasser
Copy link
Member

Addresses #5510.


// 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) {
Copy link
Contributor

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.

@mhegazy
Copy link
Contributor

mhegazy commented Nov 7, 2015

@DanielRosenwasser can you update please. i think this is blocking @alexeagle

@alexeagle
Copy link
Contributor

No, not blocking, we have a workaround (return the ES5 stdlib from CompilerHost#getDefaultLibFilename)

@DanielRosenwasser
Copy link
Member Author

@mhegazy check out my recent changes.

@mhegazy
Copy link
Contributor

mhegazy commented Nov 9, 2015

👍

DanielRosenwasser added a commit that referenced this pull request Nov 9, 2015
…ultLib

Skip files with no-default-lib when '--skipDefaultLibCheck' and '--noLib' are used
@DanielRosenwasser DanielRosenwasser merged commit 92d37c3 into master Nov 9, 2015
@DanielRosenwasser DanielRosenwasser deleted the skipDefaultLibCheckWithNoDefaultLib branch November 9, 2015 23:43
@DanielRosenwasser DanielRosenwasser changed the title Skip files with no-default-lib when '--skipDefaultLibCheck' and '--noLib' are used Skip files with no-default-lib when '--skipDefaultLibCheck' are used Nov 10, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants