Merge branch 'skipLibCheck'

This commit is contained in:
Anders Hejlsberg 2016-05-23 10:46:29 -07:00
commit ec92f7eb4d
4 changed files with 15 additions and 8 deletions

View File

@ -16383,14 +16383,11 @@ namespace ts {
function checkSourceFileWorker(node: SourceFile) {
const links = getNodeLinks(node);
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 (compilerOptions.skipDefaultLibCheck) {
// 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 (node.hasNoDefaultLib) {
return;
}
// If skipLibCheck is enabled, skip type checking if file is a declaration file.
// If skipDefaultLibCheck is enabled, skip type checking if file contains a
// '/// <reference no-default-lib="true"/>' directive.
if (compilerOptions.skipLibCheck && node.isDeclarationFile || compilerOptions.skipDefaultLibCheck && node.hasNoDefaultLib) {
return;
}
// Grammar checking

View File

@ -139,6 +139,11 @@ namespace ts {
name: "skipDefaultLibCheck",
type: "boolean",
},
{
name: "skipLibCheck",
type: "boolean",
description: Diagnostics.Skip_type_checking_of_declaration_files,
},
{
name: "out",
type: "string",

View File

@ -2348,6 +2348,10 @@
"category": "Message",
"code": 6011
},
"Skip type checking of declaration files.": {
"category": "Message",
"code": 6012
},
"Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES2015'": {
"category": "Message",
"code": 6015

View File

@ -2505,6 +2505,7 @@ namespace ts {
allowJs?: boolean;
noImplicitUseStrict?: boolean;
strictNullChecks?: boolean;
skipLibCheck?: boolean;
listEmittedFiles?: boolean;
lib?: string[];
/* @internal */ stripInternal?: boolean;