An Angular output has the name of a native DOM event such as click or change

tx0/ts:output-shadows-dom-eventrecommendedwarningreliability/logicdepth fastbug

What it finds

A listener (click) on a component's element hears both the component's output and the native click that bubbles from its content, so the handler runs twice or with the wrong kind of value.

Reported are outputs, declared with @Output() or output(), named after common DOM events.

From the rule's source, output_shadows_dom_event.rs.

Example from the rule's tests
import { Component, EventEmitter, Output } from "@angular/core";@Component({ selector: "app-card", template: "" })export class CardComponent {  @Output() click = new EventEmitter<void>();tx0 reports: the output click has the name of a native DOM event  @Output() picked = new EventEmitter<void>();}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/ts:output-shadows-dom-event" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/ts:output-shadows-dom-event] reason="..."

tx0 explain tx0/ts:output-shadows-dom-event shows the same in the terminal. Found a false positive? Report it.