From 41f6c5ef6b758e65b10e62e72198fb6857dede8e Mon Sep 17 00:00:00 2001 From: Yui T Date: Mon, 6 Feb 2017 20:07:58 -0800 Subject: [PATCH] Only report an error in non ambient context and with no noEmit flag --- src/compiler/checker.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index eb78885ea5e..1564f0c7f69 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -21909,7 +21909,8 @@ namespace ts { } } - if (hasModifier(node.parent.parent, ModifierFlags.Export) && compilerOptions.module !== ModuleKind.ES2015) { + if (compilerOptions.module !== ModuleKind.ES2015 && !compilerOptions.noEmit && + !isInAmbientContext(node.parent.parent) && hasModifier(node.parent.parent, ModifierFlags.Export)) { checkESModuleMarker(node.name); }