Skip to content

jsdoc property description does not work on index signatures #47933

@ab-pm

Description

@ab-pm

🔎 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
}

Playground with relevant code

🙁 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)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions