Skip files with no-default-lib when '--skipDefaultLibCheck' and '--noLib' are used.

This commit is contained in:
Daniel Rosenwasser
2015-11-03 12:53:31 -08:00
parent 51965b66d2
commit 2be7f4f27b
+10 -2
View File
@@ -14058,8 +14058,16 @@ namespace ts {
if (!(links.flags & NodeCheckFlags.TypeChecked)) {
// Check whether the file has declared it is the default lib,
// and whether the user has specifically chosen to avoid checking it.
if (node.isDefaultLib && compilerOptions.skipDefaultLibCheck) {
return;
if (compilerOptions.skipDefaultLibCheck) {
if (node.isDefaultLib) {
return;
}
// 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) {
return;
}
}
// Grammar checking