-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
Experience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
Bug Report
π Search Terms
- JSDoc object method parameter
π Version & Regression Information
- This is the behavior in every version I tried
β― Playground Link
Playground link with relevant code
π» Code
type Options = {
/**
* A callback to create a redirect rule.
* @param path An existing route path
* @returns All the paths from which we should redirect to `path`
*/
createRedirects: (
/** An existing route path */
path: string,
) => string[] | string | null | undefined;
}
const options: Options = {
createRedirects(path) {
return null;
}
}π Actual behavior
No JSDoc is shown when hovering over the path parameter:
π Expected behavior
The JSDoc should be attached, either by recognizing the @param, or the comment directly attached to the parameter type.
The following all work:
Intellisense when completing the method
Intellisense when calling the method
Destructuring object parameter
type Options = {
/**
* A callback to create a redirect rule.
* @returns All the paths from which we should redirect to `path`
*/
createRedirects: (args: {
/** An existing route path */
path: string,
}) => string[] | string | null | undefined;
}
const options: Options = {
createRedirects({path}) {
return null;
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Experience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsSuggestionAn idea for TypeScriptAn idea for TypeScript



