mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Skip files with no-default-lib when '--skipDefaultLibCheck' and '--noLib' are used.
This commit is contained in:
+10
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user