Documented attributes
observed attributes have a jsdoc description.
undocumented-attribute — run only this rule with
banira lint src/*.ts --rules undocumented-attribute.Observed attributes are public inputs. A jsdoc description on the attribute's accessor flows into the manifest, the generated docs and IDE autocomplete. banira flags any observed attribute whose manifest entry has no description.
export class MyButton extends HTMLElement {
static observedAttributes = ['variant'];
get variant() { return this.getAttribute('variant') ?? 'primary'; }
set variant(v) { this.setAttribute('variant', v); }
}
customElements.define('my-button', MyButton);export class MyButton extends HTMLElement {
static observedAttributes = ['variant'];
/** Visual style: 'primary' | 'secondary' | 'ghost'. */
get variant() { return this.getAttribute('variant') ?? 'primary'; }
set variant(v) { this.setAttribute('variant', v); }
}
customElements.define('my-button', MyButton);