Microsoft/TypeScript
GitHub ã§èŠãDerived class constructor parameter incorrectly inherits JSDoc from parent class's field of the same name
Open
#62,069 opened on 2025幎7æ15æ¥
BugDomain: JSDocHelp Wanted
Repository metrics
- Stars
- Â (48,455 stars)
- PR merge metrics
-  (å¹³åããŒãž 6d 17h) (30d ã§ 9 merged PRs)
説æ
ð Search Terms
inheritance, JSDoc,
ð Version & Regression Information
- This is the behavior in every version I tried
⯠Playground Link
ð» Code
class Base {
/**
* This is a description of `someField` in the `Base` class.
*
* @deprecated
*/
someField: string = 'whatever';
}
class Derived extends Base {
// This `someField` has nothing to do with `someField` in the base class,
// so it should not inherit its JSDoc.
constructor(someField: string) {
super();
console.log(someField);
}
}
ð Actual behavior
Hovering shows the JSDoc from the parent class
ð Expected behavior
Hovering should not show any JSDoc description
Additional information about the issue
This impacts https://github.com/typescript-eslint/typescript-eslint/issues/11394, since we look for @deprecated JSDoc attributes via the API, which are showing up spuriously in this case.