feat: support JSDoc @event, @fires, @emits, and @listens tags#800
Merged
Conversation
Adds three new JsDocTag variants for documenting events on classes that fire or listen for them, e.g. subclasses of EventTarget: - `@event <name>` — declares an event a class can emit - `@fires <name>` / `@emits <name>` — documents which events a method/function fires - `@listens <name>` — documents which events a symbol listens for Names follow the JSDoc convention (e.g. `Hurl#snowball`) and an optional trailing description is captured into `doc`. Refs denoland/deno#26697 Co-Authored-By: Divy Srivastava <me@littledivy.com>
|
|
2 tasks
littledivy
approved these changes
Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds three new
JsDocTagvariants to support JSDoc's event-documentation tags so that classes which fire events (e.g.EventTargetsubclasses) can be documented withdeno doc/ on JSR.Implements:
@event <name>— declares an event a class can emit@fires <name>(alias@emits <name>) — documents which events a method/function fires@listens <name>— documents which events a symbol listens forNames follow the JSDoc convention (e.g.
Hurl#snowball,module:hurler~snowball); an optional trailing description is captured intodoc.The new variants are wired into the printer (
deno docterminal output), thetags_same_kinddiff helper, and have new serialization and parsing tests.Example:
Refs denoland/deno#26697