Documented events
dispatched events are documented with @fires.
undocumented-event — run only this rule with
banira lint src/*.ts --rules undocumented-event.Events are part of a component's public API. Documenting each one with a class-level @fires tag
puts it in the Custom Elements Manifest — and therefore in the generated types, editor data and docs — so consumers can
discover it. banira flags any event it sees dispatched that has no @fires entry.
export class MyToggle extends HTMLElement {
toggle() {
this.dispatchEvent(new CustomEvent('change', { detail: { on: this.on } }));
}
}
customElements.define('my-toggle', MyToggle);/**
* @fires change - when the toggle flips; detail: { on: boolean }
*/
export class MyToggle extends HTMLElement {
toggle() {
this.dispatchEvent(new CustomEvent('change', { detail: { on: this.on } }));
}
}
customElements.define('my-toggle', MyToggle);