← All recipes
Moderne licensed

Remove empty ngOnInit lifecycle hooks

Recipe IDorg.openrewrite.angular.migration.remove-empty-ng-on-initArtifact@openrewrite/recipes-angular

Removes empty ngOnInit lifecycle hook methods and OnInit interface from Angular components.

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.remove-empty-ng-on-init

If the recipe isn’t available locally, install it with:

mod config recipes npm install @openrewrite/recipes-angular