TypeScript
TypeScript copied to clipboard
jsdoc property description does not work on index signatures
🔎 Search Terms
index signature description documentation comment annotation jsdoc
💻 Code
interface Example {
/** Something generic */
[p: string]: any;
/** Something specific */
property: number;
}
function example(e: Example) {
console.log(e.property); // works, shows type and description on hover
console.log(e.anything); // shows type of property but not description on hover
}
🙁 Actual behavior
e.anything only gets the type (any) declared for the property
🙂 Expected behavior
When hovering over the property e.anything, the description "Something generic" should show up in the tooltip
(this is a folloup to #47256)