Add ChangeDetectionStrategy.Eager to components
Recipe ID
org.openrewrite.angular.migration.add-eager-change-detectionArtifact@openrewrite/recipes-angularAdds changeDetection: ChangeDetectionStrategy.Eager to @Component decorators that do not specify a change detection strategy. Angular 22 changed the default for such components to ChangeDetectionStrategy.OnPush; making the previous check-always behavior explicit keeps them working unchanged.
Single recipeProprietary
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.angular.migration.add-eager-change-detectionIf the recipe isn’t available locally, install it with:
mod config recipes npm install @openrewrite/recipes-angular