undocumented-slot

Documented slots

rendered s are documented with @slot (content model).

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

Why it matters

Slots define a component's content model — where consumer markup is projected. Document each rendered slot with a class-level @slot tag (use @slot - … for the default slot). banira mounts the element and flags any rendered slot that isn't documented.

✗ Flagged

src/my-field.ts — renders a named slot, undocumented
export class MyField extends HTMLElement {
  connectedCallback() {
    this.attachShadow({ mode: 'open' }).innerHTML =
      '<label><slot name="label"></slot><input></label>';
  }
}
customElements.define('my-field', MyField);

✓ Good

src/my-field.ts — @slot documents the content model
/**
 * @slot label - the field's label content
 */
export class MyField extends HTMLElement {
  connectedCallback() {
    this.attachShadow({ mode: 'open' }).innerHTML =
      '<label><slot name="label"></slot><input></label>';
  }
}
customElements.define('my-field', MyField);