-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationDomain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallyDomain: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.checkJsRelates to checking JavaScript using TypeScriptRelates to checking JavaScript using TypeScript
Milestone
Description
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.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationDomain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallyDomain: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.checkJsRelates to checking JavaScript using TypeScriptRelates to checking JavaScript using TypeScript