Check for both 'module' and 'target'.

This commit is contained in:
Daniel Rosenwasser
2018-04-27 17:51:18 -07:00
parent bc0d3e1297
commit 161535bc84
+1 -1
View File
@@ -18812,7 +18812,7 @@ namespace ts {
}
function checkImportMetaProperty(node: MetaProperty) {
if (languageVersion < ScriptTarget.ESNext && moduleKind < ModuleKind.ESNext) {
if (languageVersion < ScriptTarget.ESNext || moduleKind < ModuleKind.ESNext) {
error(node, Diagnostics.The_import_meta_meta_property_is_only_allowed_using_ESNext_for_the_target_and_module_compiler_options);
}
const file = getSourceFileOfNode(node);