An Angular component or directive declares its outputs in the outputs list of its metadata

tx0/ts:outputs-metadata-propertyrecommendedwarningframeworks/angulardepth fastsmell

What it finds

Outputs listed as strings in the decorator's metadata are far from the properties they bind, are not checked by the compiler and are easy to miss. @Output() or output() on the property keeps the declaration where the property is.

Reported are outputs properties in the metadata of @Component and @Directive.

From the rule's source, outputs_metadata_property.rs.

Example from the rule's tests
import { Component, EventEmitter } from "@angular/core";@Component({ selector: "app-card", template: "", outputs: ["picked"] })tx0 reports: outputs are declared in the metadataexport class CardComponent {  picked = new EventEmitter<string>();}
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:outputs-metadata-property" = "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:outputs-metadata-property] reason="..."

tx0 explain tx0/ts:outputs-metadata-property shows the same in the terminal. Found a false positive? Report it.