Skip to content

when using ts.getJSDocTags, the value of @type is not returned. Is there any solution? #58314

Closed as not planned
@canyuegongzi

Description

@canyuegongzi

🔎 Search Terms

ts.getJSDocTags、type、get jsDoc、 get js doc tags

🕗 Version & Regression Information

  • This is a crash
  • This changed between versions 5.4.5 and _______
  • This changed in commit or PR _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
  • I was unable to test this on prior versions because _______

⏯ Playground Link

No response

💻 Code

export default interface CommonHeaderIProps {
  /**
   * name
   *
   * @title name
   * @type string
   * @default true
   */
  testList: TestListData;
}

// code
const jsdoc = ts.getJSDocTags(node);
// code

🙁 Actual behavior

the value of type is not actually returned
{ title: 'name', type: undefined, default: 'true' }
image

🙂 Expected behavior

Can correctly return the value string of @type annotation instead of returning undefined,
example:
{ title: 'name', type: 'string', default: 'true' }

Additional information about the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions