Microsoft/TypeScript
View on GitHubDerived class constructor parameter incorrectly inherits JSDoc from parent class's field of the same name
Open
#62,069 opened on Jul 15, 2025
BugDomain: JSDocHelp Wanted
Description
🔎 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.