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
2024-04-24 21:18:31 -07:00
committed by GitHub
parent e28ad995d1
commit 501fa6e4e4
4 changed files with 67 additions and 1 deletions
+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)) {