From 4dc3cd3773ac3008d662c1093e35e11dafa2fd65 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 10 Jul 2018 15:28:21 -0700 Subject: [PATCH] Use getEmitModuleKind to check module generation kind --- src/compiler/program.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 9a492c1df82..a1a06eaa1ea 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -2549,7 +2549,7 @@ namespace ts { createDiagnosticForOptionName(Diagnostics.Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy, "resolveJsonModule"); } // Any emit other than common js is error - else if (options.module !== undefined && options.module !== ModuleKind.CommonJS) { + else if (getEmitModuleKind(options) !== ModuleKind.CommonJS) { createDiagnosticForOptionName(Diagnostics.Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs, "resolveJsonModule", "module"); } }