mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-22 22:55:36 -05:00
Merge pull request #11119 from YuichiNukiyama/defult_export_error_message
Change error message for default export in namespace
This commit is contained in:
@@ -19107,7 +19107,13 @@ namespace ts {
|
||||
|
||||
const container = node.parent.kind === SyntaxKind.SourceFile ? <SourceFile>node.parent : <ModuleDeclaration>node.parent.parent;
|
||||
if (container.kind === SyntaxKind.ModuleDeclaration && !isAmbientModule(container)) {
|
||||
error(node, Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace);
|
||||
if (node.isExportEquals) {
|
||||
error(node, Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace);
|
||||
}
|
||||
else {
|
||||
error(node, Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
// Grammar checking
|
||||
|
||||
@@ -855,6 +855,10 @@
|
||||
"category": "Error",
|
||||
"code": 1318
|
||||
},
|
||||
"A default export can only be used in an ECMAScript-style module.": {
|
||||
"category": "Error",
|
||||
"code": 1319
|
||||
},
|
||||
"Duplicate identifier '{0}'.": {
|
||||
"category": "Error",
|
||||
"code": 2300
|
||||
|
||||
Reference in New Issue
Block a user