Skip to content

JsDoc annotations don't play well with arguments destructuring #19645

Closed
@KtorZ

Description

@KtorZ

Code

As stated in this comment (I am afraid this won't be seen since the issue is closed, hence the issue):

/**
 * @param {Object} args 
 * @param {string} args.prop1
 * @param {string} args.prop2
 */
function patate({ prop1, prop2 }) {

}

Expected behavior:

Type-checking this using --allowJs and --checkJs shouldn't result in an error but rather apply the right type-annotations to the both properties.

Actual behavior:
The compiler raises the following error:

error TS8024: JSDoc '@param' tag has name 'args', but there is no parameter with that name.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationFixedA PR has been merged for this issueHelp WantedYou can do this

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions