From 2be7f4f27b0e60ea19a83a291f353a4a9238390f Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 3 Nov 2015 12:53:31 -0800 Subject: [PATCH] Skip files with no-default-lib when '--skipDefaultLibCheck' and '--noLib' are used. --- src/compiler/checker.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 65f507c13c0..3fd42865c32 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -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 `/// , + // then we should treat that file as a default lib. + if (compilerOptions.noLib && node.hasNoDefaultLib) { + return; + } } // Grammar checking