undocumented-attribute

Documented attributes

observed attributes have a jsdoc description.

Rule id undocumented-attribute — run only this rule with banira lint src/*.ts --rules undocumented-attribute.

Why it matters

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.

✗ Flagged

src/my-button.ts — observed attribute with 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);

✓ Good

src/my-button.ts — the accessor carries a jsdoc description
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);