Bug Report
π Search Terms
jsdoc docblock typedef
π Version & Regression Information
- This is the behavior in every version I tried
β― Playground Link
playground
π» Code
/** @typedef {{foo: 'foo'}} Foo */
function f() {
}
f()
π Actual behavior
Whenever JSDoc typedef blocks are followed by a function (or variable) declaration TS attaches that JSDoc to the function and shows typedefs as part of the function's description when its name is hovered.

(The described behavior is old, but the screenshot of v4.3.0-dev is here to show an extra bug with [object Object].)
π Expected behavior
Typedefs shouldn't be attached to subsequent statements.
As Nathan Shively-Sanders (@sandersn) wrote in #42895 (comment):
Declaration-like jsdocs are incorrectly attached to the following statement. The fix is probably as simple as a filter somewhere -- the compiler itself doesn't care where @typedef is, only the services layer does -- but I'm not sure which component should do the filtering.
Bug Report
π Search Terms
jsdoc docblock typedef
π Version & Regression Information
β― Playground Link
playground
π» Code
π Actual behavior
Whenever JSDoc typedef blocks are followed by a function (or variable) declaration TS attaches that JSDoc to the function and shows typedefs as part of the function's description when its name is hovered.
(The described behavior is old, but the screenshot of v4.3.0-dev is here to show an extra bug with
[object Object].)π Expected behavior
Typedefs shouldn't be attached to subsequent statements.
As Nathan Shively-Sanders (@sandersn) wrote in #42895 (comment):