web-component-analyzer icon indicating copy to clipboard operation
web-component-analyzer copied to clipboard

Why @fires instead of @event for declaring events?

Open FluorescentHallucinogen opened this issue 3 years ago • 1 comments

Why web-component-analyzer uses the @fires instead of @event JSDoc tag for declaring events?

According to JSDoc doc:

The @fires tag indicates that a method can fire a specified type of event when it is called. Use the @event tag to document the event's content.

The Polymer project also uses the @event tag for declaring events.

@runem @daKmoR @justinfagnani PTAL.

FluorescentHallucinogen avatar Dec 06 '20 13:12 FluorescentHallucinogen

In plain jsdoc its because @fires defines what will be fired, @event defines what the type is. You'd normally use both.

but syntax has diverged a bit across a few different projects:

  • @fires some-event in jsdoc's own docs
  • @fires some-event in mwc
  • @fires some-event {SomeType} in mwc
  • @fires {SomeType} some-event in this repo
  • @event some-event
  • @event {SomeType}
  • etc etc

43081j avatar May 03 '21 09:05 43081j