Only report an error in non ambient context and with no noEmit flag

This commit is contained in:
Yui T 2017-02-06 20:07:58 -08:00
parent 11cac43c34
commit 41f6c5ef6b

View File

@ -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);
}