diff --git a/README.md b/README.md index c5fdf925..77bcb833 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ The default `tsconfig.json` file used by the plugin looks like this: ```json { "compilerOptions": { + "noEmit": false, "preserveConstEnums": true, "strictNullChecks": true, "sourceMap": true, @@ -47,7 +48,7 @@ The default `tsconfig.json` file used by the plugin looks like this: } ``` -> Note 1: The `outDir` and `rootDir` options cannot be overwritten. +> Note 1: The `outDir`, `rootDir` and `noEmit` options cannot be overwritten. > Note 2: Don't confuse the [`tsconfig.json`](tsconfig.json) in this repository with the one mentioned above. diff --git a/src/typescript.ts b/src/typescript.ts index f18e59b4..e38dad9e 100644 --- a/src/typescript.ts +++ b/src/typescript.ts @@ -6,6 +6,7 @@ import * as path from 'path' export function makeDefaultTypescriptConfig() { const defaultTypescriptConfig: ts.CompilerOptions = { + noEmit: false, preserveConstEnums: true, strictNullChecks: true, sourceMap: true, @@ -120,12 +121,18 @@ export function getTypescriptConfig( logger.log(`Using local tsconfig.json`) } - // disallow overrriding rootDir + // disallow overriding rootDir if (configParseResult.options.rootDir && path.resolve(configParseResult.options.rootDir) !== path.resolve(cwd) && logger) { - logger.log('Warning: "rootDir" from local tsconfig.json is overriden') + logger.log('Warning: "rootDir" from local tsconfig.json is overridden') } configParseResult.options.rootDir = cwd + // disallow overriding noEmit + if (configParseResult.options.noEmit !== false) { + logger.log('Warning: "noEmit" from local tsconfig.json is overridden') + } + configParseResult.options.noEmit = false + return configParseResult.options }