Open FluorescentHallucinogen opened 3 years ago
@runem @bennypowers @daKmoR @justinfagnani @thepassle @robdodson @adriengibrat PTAL.
IIRC
/**
* @attr {Boolean} supported
*/
https://github.com/runem/web-component-analyzer#-how-to-document-your-components-using-jsdoc
First of all, I don't think it's a good idea to tag so much of people (mostly unrelated to this project) during the weekend 🙁
When in doubt, please check with the tests, this project has a bunch of those including this one:
I'm writing a vanilla native web component, not using TypeScript and any web component libraries like LitElement, etc.
My web component has a
supported
property and a corresponding HTML element attribute with the same name:Is this JSDoc annotation correct?
Does
web-component-analyzer
support@readonly
?I need that
@type
and@readonly
will be applied to both the property and the attribute, not to only the property.Technically, HTML element attributes are always strings (complex data like arrays and objects should be serialized as JSON strings). But as an author, I know the original type. What type should I declare for attributes in JSDoc (actual or original)?
Moreover, since my attribute is boolean, if the corresponding property is true, the attribute is present in the HTML markup:
but does the
supported
attribute has a value in this case? If so, which one? What type is it?If the corresponding property is false, the attribute is just missing in the HTML markup:
but does the
supported
attribute has a value in this case? If so, which one? What type is it?