Bug Report
π Search Terms
jsdoc
π Version & Regression Information
- This changed between versions 4.6.0-beta and 4.6.1-rc
β― Playground Link
Playground link with relevant code
π» Code
class Bug {
/**
* @param {some-module.Request} request
*/
sendRequest(request: unknown): void {
arguments; // Remove this, error goes away
}
}
π Actual behavior
An error occurs in the type of the @param jsdoc tag: Cannot find name 'some'.
π Expected behavior
No error occurs on the @param jsdoc tag
Notes
This only happens if arguments is referenced in the body of the method.
This behavior was introduced in #47257 (ping @a-tarasyuk )
The issue seems to be that if arguments is referenced then getTypeFromTypeNode(lastJSDocParam.typeExpression.type) (Line) is invoked to see if the the last parameter is an array type. The problem is getTypeFromTypeNode will add the diagnostics about being unable to find some even though in this context we probably don't want to add it.
Bug Report
π Search Terms
jsdoc
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
An error occurs in the type of the
@paramjsdoc tag:Cannot find name 'some'.π Expected behavior
No error occurs on the
@paramjsdoc tagNotes
This only happens if
argumentsis referenced in the body of the method.This behavior was introduced in #47257 (ping @a-tarasyuk )
The issue seems to be that if
argumentsis referenced thengetTypeFromTypeNode(lastJSDocParam.typeExpression.type)(Line) is invoked to see if the the last parameter is an array type. The problem isgetTypeFromTypeNodewill add the diagnostics about being unable to findsomeeven though in this context we probably don't want to add it.