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