mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 20:37:00 -05:00
Fix error on interfaces in .js files (#35969)
* Use the correct error message. * Accepted baselines.
This commit is contained in:
committed by
GitHub
parent
82b0547281
commit
75ca64120f
@@ -1837,7 +1837,9 @@ namespace ts {
|
||||
}
|
||||
break;
|
||||
case SyntaxKind.InterfaceDeclaration:
|
||||
diagnostics.push(createDiagnosticForNode(node, Diagnostics.Interface_declaration_cannot_have_implements_clause));
|
||||
const interfaceKeyword = tokenToString(SyntaxKind.InterfaceKeyword);
|
||||
Debug.assertDefined(interfaceKeyword);
|
||||
diagnostics.push(createDiagnosticForNode(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, interfaceKeyword));
|
||||
return;
|
||||
case SyntaxKind.ModuleDeclaration:
|
||||
const moduleKeyword = node.flags & NodeFlags.Namespace ? tokenToString(SyntaxKind.NamespaceKeyword) : tokenToString(SyntaxKind.ModuleKeyword);
|
||||
|
||||
Reference in New Issue
Block a user