From 757af2e1d6ae10666aa1f26cb7efdc59e01884d5 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Thu, 12 Jan 2017 13:11:26 -0800 Subject: [PATCH] Fix tsconfig inheritance in gulpfile -- must do it manually --- Gulpfile.ts | 14 ++++++-------- src/compiler/sys.ts | 2 +- src/tsconfig-base.json | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Gulpfile.ts b/Gulpfile.ts index ef65454bc23..2daa8970582 100644 --- a/Gulpfile.ts +++ b/Gulpfile.ts @@ -242,13 +242,14 @@ function needsUpdate(source: string | string[], dest: string | string[]): boolea return true; } +// Doing tsconfig inheritance manually. https://github.com/ivogabe/gulp-typescript/issues/459 +const tsconfigBase = JSON.parse(fs.readFileSync("src/tsconfig-base.json", "utf-8")).compilerOptions; + function getCompilerSettings(base: tsc.Settings, useBuiltCompiler?: boolean): tsc.Settings { const copy: tsc.Settings = {}; - copy.noEmitOnError = true; - copy.noImplicitAny = true; - copy.noImplicitThis = true; - copy.pretty = true; - copy.types = []; + for (const key in tsconfigBase) { + copy[key] = tsconfigBase[key]; + } for (const key in base) { copy[key] = base[key]; } @@ -256,9 +257,6 @@ function getCompilerSettings(base: tsc.Settings, useBuiltCompiler?: boolean): ts if (copy.removeComments === undefined) copy.removeComments = true; copy.newLine = "lf"; } - else { - copy.preserveConstEnums = true; - } if (useBuiltCompiler === true) { copy.typescript = require("./built/local/typescript.js"); } diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index 8e140375dd0..966f0e0cd03 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -18,7 +18,7 @@ namespace ts { getFileSize?(path: string): number; writeFile(path: string, data: string, writeByteOrderMark?: boolean): void; /** - * @pollingInterval - this parameter is used in polling-based watchers and ignored in watchers that + * @pollingInterval - this parameter is used in polling-based watchers and ignored in watchers that * use native OS file watching */ watchFile?(path: string, callback: FileWatcherCallback, pollingInterval?: number): FileWatcher; diff --git a/src/tsconfig-base.json b/src/tsconfig-base.json index d3fcf8f1520..b4c82dbeeee 100644 --- a/src/tsconfig-base.json +++ b/src/tsconfig-base.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "lib": ["es5"], + "noEmitOnError": true, "noImplicitAny": true, "noImplicitThis": true, "noUnusedLocals": true,