Skip to content

JSDoc comments for async_hooks are confusing/misleading #62967

Description

Acknowledgement

  • I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion.

Comment

The JSDoc comments from the async_hooks module state not to use the module, and then go on to immediately suggest an "alternative" that is in the module itself.

We strongly discourage the use of the async_hooks API

  • AsyncLocalStorage

If you look at the node.js docs, it makes sense because these two things are on separate pages, but in TS, this warning is shown on import { AsyncLocalStorage } from 'node:async_hooks';

This might be a larger codegen/docs issue as well for other modules that have multiple doc pages.

Activity

  1. pranamya123 commented on Jan 16, 2026

    @pranamya123

    Hi a-non-a-mouse I’ve opened a PR in DefinitelyTyped to clarify the async_hooks JSDoc warning so it doesn’t read as discouraging the module while recommending AsyncLocalStorage from the same import.

  2. Ayoub-glitsh commented on Feb 10, 2026

    @Ayoub-glitsh

    Hi a-non-a-mouse, thanks for pointing this out the current JSDoc is indeed confusing from a TypeScript consumer perspective.
    I’d be happy to help address this by clarifying the JSDoc so the guidance around async_hooks and AsyncLocalStorage is accurate and non-misleading. If this issue is still open for contributions, I can work on a fix or follow up on the existing approach.
    Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions