mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Use no-default-lib for the '--noLibCheck' flag.
This commit is contained in:
@@ -10934,10 +10934,12 @@ module ts {
|
||||
|
||||
function checkSourceFile(node: SourceFile) {
|
||||
let start = new Date().getTime();
|
||||
let skipCheck = node.fileName.indexOf("lib.d.ts") >= 0 && compilerOptions.noLibCheck;
|
||||
|
||||
let skipCheck = node.hasNoDefaultLib && compilerOptions.noLibCheck;
|
||||
if (!skipCheck) {
|
||||
checkSourceFileWorker(node);
|
||||
}
|
||||
|
||||
checkTime += new Date().getTime() - start;
|
||||
}
|
||||
|
||||
|
||||
@@ -1004,6 +1004,14 @@ module ts {
|
||||
amdModuleName: string;
|
||||
referencedFiles: FileReference[];
|
||||
|
||||
/**
|
||||
* lib.d.ts should have a reference comment like
|
||||
*
|
||||
* /// <reference no-default-lib="true"/>
|
||||
*
|
||||
* which serves the purpose of ignoring the file in certain ways in the
|
||||
* presence of compiler options like '--noLib' and '--noLibCheck'.
|
||||
*/
|
||||
hasNoDefaultLib: boolean;
|
||||
|
||||
languageVersion: ScriptTarget;
|
||||
@@ -1042,7 +1050,7 @@ module ts {
|
||||
(fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void;
|
||||
}
|
||||
|
||||
export interface Program extends ScriptReferenceHost {
|
||||
export interface Program extends ScriptReferenceHost, TypeCheckerHost {
|
||||
/**
|
||||
* Get a list of files in the program
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user