Skip to content

Commit

Permalink
Use suggestion instead of ignoring UMD global access
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbranch committed Apr 8, 2019
1 parent 98cd89f commit 786753d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1632,10 +1632,10 @@ namespace ts {
}

// If we're in an external module, we can't reference value symbols created from UMD export declarations
if (!compilerOptions.allowUmdGlobalAccess && result && isInExternalModule && (meaning & SymbolFlags.Value) === SymbolFlags.Value && !(originalLocation!.flags & NodeFlags.JSDoc)) {
if (result && isInExternalModule && (meaning & SymbolFlags.Value) === SymbolFlags.Value && !(originalLocation!.flags & NodeFlags.JSDoc)) {
const merged = getMergedSymbol(result);
if (length(merged.declarations) && every(merged.declarations, d => isNamespaceExportDeclaration(d) || isSourceFile(d) && !!d.symbol.globalExports)) {
error(errorLocation!, Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, unescapeLeadingUnderscores(name));
errorOrSuggestion(!compilerOptions.allowUmdGlobalAccess, errorLocation!, Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, unescapeLeadingUnderscores(name));
}
}
}
Expand Down

0 comments on commit 786753d

Please sign in to comment.