Treat functions with @type tags on parameters as typed in JS files (#61177)

This commit is contained in:
Mateusz Burzyński
2025-04-15 00:35:20 +02:00
committed by GitHub
parent 83dc0bb2ed
commit eef7c14ef1
4 changed files with 108 additions and 0 deletions

View File

@@ -15507,6 +15507,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
isInJSFile(declaration) &&
isValueSignatureDeclaration(declaration) &&
!hasJSDocParameterTags(declaration) &&
!some(declaration.parameters, p => !!getJSDocType(p)) &&
!getJSDocType(declaration) &&
!getContextualSignatureForFunctionLikeDeclaration(declaration);
if (isUntypedSignatureInJSFile) {