From d0468792ebbbd16eb62755124d5be22223ab2ba8 Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Tue, 3 Nov 2020 10:12:10 -0500 Subject: [PATCH] allow typeCheck cli flag to override transpileOnly tsconfig flag (#1142) --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index e2b759afc..491f7f4dc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -447,7 +447,8 @@ export function create (rawOptions: CreateOptions = {}): Register { const readFile = options.readFile || ts.sys.readFile const fileExists = options.fileExists || ts.sys.fileExists - const transpileOnly = options.transpileOnly === true || options.typeCheck === false + // typeCheck can override transpileOnly, useful for CLI flag to override config file + const transpileOnly = options.transpileOnly === true && options.typeCheck !== true const transformers = options.transformers || undefined const ignoreDiagnostics = [ 6059, // "'rootDir' is expected to contain all source files."