An Angular output is named with the prefix on, which templates reserve for handlers
What it finds
In Angular templates an output is bound as (picked)="onPicked()": the event is named for what happened, the handler with on. An output called onPicked reads as a handler and doubles the prefix in bindings.
Reported are outputs, declared with @Output() or output(), named on or starting with on and a capital letter.
From the rule's source, output_on_prefix.rs.
import { Component, EventEmitter, Output } from "@angular/core";@Component({ selector: "app-card", template: "" })export class CardComponent { @Output() onPicked = new EventEmitter<void>();tx0 reports: the output onPicked is named like a handler} 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:
[rules]
"tx0/ts:output-on-prefix" = "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-on-prefix] reason="..."tx0 explain tx0/ts:output-on-prefix shows the same in the terminal. Found a false positive? Report it.