Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
consider type only alias as valid for jsdoc context
  • Loading branch information
a-tarasyuk committed Jan 17, 2025
commit 82e76ec26bac215d7dc19bd3b1097beaf4505b70
5 changes: 2 additions & 3 deletions src/compiler/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10454,6 +10454,7 @@ export function isValidBigIntString(s: string, roundTripOnly: boolean): boolean
/** @internal */
export function isValidTypeOnlyAliasUseSite(useSite: Node): boolean {
return !!(useSite.flags & NodeFlags.Ambient)
|| isInJSDoc(useSite)
|| isPartOfTypeQuery(useSite)
|| isIdentifierInNonEmittingHeritageClause(useSite)
|| isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite)
Expand Down Expand Up @@ -10483,7 +10484,6 @@ function isIdentifierInNonEmittingHeritageClause(node: Node): boolean {
if (node.kind !== SyntaxKind.Identifier) return false;
const heritageClause = findAncestor(node.parent, parent => {
switch (parent.kind) {
case SyntaxKind.JSDocImplementsTag:
case SyntaxKind.HeritageClause:
return true;
case SyntaxKind.PropertyAccessExpression:
Expand All @@ -10493,8 +10493,7 @@ function isIdentifierInNonEmittingHeritageClause(node: Node): boolean {
return "quit";
}
}) as HeritageClause | undefined;
if (heritageClause === undefined) return false;
return isJSDocImplementsTag(heritageClause) || heritageClause.token === SyntaxKind.ImplementsKeyword || heritageClause.parent.kind === SyntaxKind.InterfaceDeclaration;
return heritageClause?.token === SyntaxKind.ImplementsKeyword || heritageClause?.parent.kind === SyntaxKind.InterfaceDeclaration;
}

/** @internal */
Expand Down
Loading