fix(58265): JSDoc comment string with the keyword "@private" before import statement in JS file result in cryptic error TS1191 during compilation (#58297)

This commit is contained in:
Oleksandr T authored and GitHub committed 2024-04-24 21:18:31 -07:00
1 parent e28ad995d1
commit 501fa6e4e4
4 files changed
+67 -1

No files matched your search

+1 -1
View File
@@ -46331,7 +46331,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
// If we hit an import declaration in an illegal context, just bail out to avoid cascading errors.
return;
}
if (!checkGrammarModifiers(node) && hasEffectiveModifiers(node)) {
if (!checkGrammarModifiers(node) && node.modifiers) {
grammarErrorOnFirstToken(node, Diagnostics.An_import_declaration_cannot_have_modifiers);
}
if (checkExternalImportOrExportDeclaration(node)) {