11ty / webc

Single File Web Components
MIT License
1.3k stars 36 forks source link

JSDoc style comment format to document/typecheck/autocomplete attributes and properties #171

Open zachleat opened 1 year ago

zachleat commented 1 year ago

Idea from @hexagoncircle

Example somewhere in a component definition file:

<!---
time-difference shows the relative time difference between a date and now.

@param {string} date
@param {string} locale
@param {("year"|"quarter"|"month"|"week"|"day"|"hour"|"minute"|"second")} units
@param {boolean} live
@param {integer} interval (in seconds)
--->

Also this might generate some relevant JSON for autocomplete in IDEs: https://mastodon.social/@khalidabuhakmeh/110225863097859563

https://github.com/JetBrains/web-types

Zearin commented 1 year ago

Also: perhaps something similar (or a standalone *.d.ts) for the purposes of learning and discovering the built-in webc:* attributes, too!