Skip to content

Commit 7bbaef6

Browse files
Change error message for referencing UMD globals from a module.
1 parent 2671668 commit 7bbaef6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ namespace ts {
922922
if (result && isInExternalModule && (meaning & SymbolFlags.Value) === SymbolFlags.Value) {
923923
const decls = result.declarations;
924924
if (decls && decls.length === 1 && decls[0].kind === SyntaxKind.NamespaceExportDeclaration) {
925-
error(errorLocation, Diagnostics.Identifier_0_must_be_imported_from_a_module, name);
925+
error(errorLocation, Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, name);
926926
}
927927
}
928928
}

src/compiler/diagnosticMessages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1923,7 +1923,7 @@
19231923
"category": "Error",
19241924
"code": 2685
19251925
},
1926-
"Identifier '{0}' must be imported from a module": {
1926+
"'{0}' refers to a UMD global, but the current file is a module. Consider adding an import instead.": {
19271927
"category": "Error",
19281928
"code": 2686
19291929
},

0 commit comments

Comments
 (0)