runem / web-component-analyzer

CLI that analyzes web components and emits documentation
https://runem.github.io/web-component-analyzer
MIT License
501 stars 63 forks source link

support event types in jsdoc #165

Closed 43081j closed 4 years ago

43081j commented 4 years ago

The JSDoc parsing function: https://github.com/runem/web-component-analyzer/blob/f0bfaf16273cf98350576241ab21a7ba00072139/src/analyze/util/js-doc-util.ts#L274

assumes types are of this format:

/**
  @param {someType} someName someDescription
*/

which is fine, except for events. a common pattern when defining an event in JSDoc is:

/**
  @fires some-name {someType}
*/

for example, mwc does this. i do too.


related problem: if we have @fires my-event {MouseEvent}, it seems this function won't bother with it and will return any.

is there any chance at some point this could be able to somehow resolve global types? or would that be lit-analyzer's job to lookup in its store?