File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -5226,7 +5226,7 @@ namespace ts {
5226
5226
let hasThisParameter: boolean;
5227
5227
const iife = getImmediatelyInvokedFunctionExpression(declaration);
5228
5228
const isJSConstructSignature = isJSDocConstructSignature(declaration);
5229
- const isUntypedSignatureInJSFile = !iife && !isJSConstructSignature && isInJavaScriptFile(declaration);
5229
+ const isUntypedSignatureInJSFile = !iife && !isJSConstructSignature && isInJavaScriptFile(declaration) && !hasJSDocParamterTags(declaration) ;
5230
5230
5231
5231
// If this is a JSDoc construct signature, then skip the first parameter in the
5232
5232
// parameter list. The first parameter represents the return type of the construct
@@ -5252,13 +5252,11 @@ namespace ts {
5252
5252
hasLiteralTypes = true;
5253
5253
}
5254
5254
5255
- const isUntypedParamInJSFile = isUntypedSignatureInJSFile && !param.type && !getJSDocParameterTags(param);
5256
-
5257
5255
// Record a new minimum argument count if this is not an optional parameter
5258
5256
const isOptionalParameter = param.initializer || param.questionToken || param.dotDotDotToken ||
5259
5257
iife && parameters.length > iife.arguments.length && !param.type ||
5260
5258
isJSDocOptionalParameter(param) ||
5261
- isUntypedParamInJSFile ;
5259
+ isUntypedSignatureInJSFile ;
5262
5260
if (!isOptionalParameter) {
5263
5261
minArgumentCount = parameters.length;
5264
5262
}
Original file line number Diff line number Diff line change @@ -1518,6 +1518,11 @@ namespace ts {
1518
1518
return map ( getJSDocs ( node ) , doc => doc . comment ) ;
1519
1519
}
1520
1520
1521
+ export function hasJSDocParamterTags ( node : FunctionLikeDeclaration | SignatureDeclaration ) {
1522
+ const parameterTags = getJSDocTags ( node , SyntaxKind . JSDocParameterTag ) ;
1523
+ return parameterTags && parameterTags . length > 0 ;
1524
+ }
1525
+
1521
1526
function getJSDocTags ( node : Node , kind : SyntaxKind ) : JSDocTag [ ] {
1522
1527
const docs = getJSDocs ( node ) ;
1523
1528
if ( docs ) {
You can’t perform that action at this time.
0 commit comments