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

JSDoc tags get lost when inheriting from a grandparent class #58151

Closed
whzx5byb opened this issue Apr 11, 2024 · 0 comments Β· Fixed by #58183
Closed

JSDoc tags get lost when inheriting from a grandparent class #58151

whzx5byb opened this issue Apr 11, 2024 · 0 comments Β· Fixed by #58183
Labels
Help Wanted You can do this Possible Improvement The current behavior isn't wrong, but it's possible to see that it might be better in some cases
Milestone

Comments

@whzx5byb
Copy link

whzx5byb commented Apr 11, 2024

πŸ”Ž Search Terms

jsdoc tag inherit

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

https://www.typescriptlang.org/play?#code/MYGwhgzhAECC0G8CwAoa7oHoBU3qo3TwBEBTCYAJwEsAHAF2oHsA7aAC1MtIDoDC8-DHgACAN2qV6AVzAghRaNkwKAZkyYAKAJSJoAX1SGUqUJBgAhaKQAe9UiwAmMeMjQYmYrjUelo6rV0EAyNUU3AoaABhazsHZ2grN0JPb2pffw0dPWN9IA

πŸ’» Code

class A {
    /** 
     * Description text here.
     * 
     * @virtual
     * */
    foo() { }
}

class B extends A {
    override foo() { }
}

class C extends B {
    override foo() { }
}

πŸ™ Actual behavior

Only the description text is provided for C.foo.

πŸ™‚ Expected behavior

Both the description text and the tag should be provided for C.foo, just as the behavior of B.foo.

Additional information about the issue

I'm trying to provide a solution for #1534 by using typescript-eslint + JSDoc tag. This bug makes @virtual tag disappear and I will not be able to override C.foo in "strict-virtual" mode.

Also note that @inheritdoc tag doesn't work here. Adding @inheritdoc to B.foo will only provide @inheritdoc itself to C.foo, instead of the @virtual tag, which is an unexpected and unuseful behavior.

@RyanCavanaugh RyanCavanaugh added Help Wanted You can do this Possible Improvement The current behavior isn't wrong, but it's possible to see that it might be better in some cases labels Apr 11, 2024
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted You can do this Possible Improvement The current behavior isn't wrong, but it's possible to see that it might be better in some cases
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants