Documented slots
rendered
undocumented-slot — run only this rule with
banira lint src/*.ts --rules undocumented-slot.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.
export class MyField extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' }).innerHTML =
'<label><slot name="label"></slot><input></label>';
}
}
customElements.define('my-field', MyField);/**
* @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);