Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inheriting JSDoc comments declared on an interface in the implementation class #2898

Closed
x11x opened this issue Jul 19, 2023 · 1 comment
Closed

Comments

@x11x
Copy link

x11x commented Jul 19, 2023

Should it be documented somewhere (i.e. the "JSDoc Reference page"?) that you can write JSDoc comments on interfaces, and implementing classes automatically inherit them?
Maybe this is specific to the tooling and not to TypeScript itself, but @inheritdoc is mentioned in the TypeScript docs.

  • @inheritdoc is listed under Unsupported tags, which says there's an open issue for it (#23215). That issue is now closed, maybe docs should change to reflect this? It looks like @inheritdoc is now supported, but only for static class members? (I'm a bit unclear).
  • However, I noticed that in tooling I use (VSCode) and also the TS Playground, that the expected thing automatically happens without the need for @inheritdoc. In fact, if you do try to use @inheritdoc, it overwrites the summary section with the string {@inheritdoc ...}, but if you omit it completely, it correctly inherits all relevant parts of the JSDoc from the interface.
  • I'm not sure what happens with documentation site generation tools. Based on reading issue #1498, it looks like TypeDoc aims to support this, but someone at the bottom mentioned it was still not working, also it is maybe less powerful or complete than VSCode (does not work for some more complex cases like Omitting members).

Playground link

@jakebailey
Copy link
Member

jakebailey commented Jul 19, 2023

If you want to send a PR to clarify something, we'd appreciate it, but per #2804, we aren't accepting issues that are not "critical", and it doesn't seem like you used the issue template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants