Find safe navigation in Angular templates

Proprietary

Finds ?. in HTML templates and in inline template metadata. Angular 22 changed safe navigation in templates to return undefined instead of null, which changes bindings that tell the two apart. Angular ships a $safeNavigationMigration() wrapper for this; this recipe reports the templates to review rather than rewriting the expressions.

org.openrewrite.angular.search.find-template-safe-navigation
mod run . --recipe=org.openrewrite.angular.search.find-template-safe-navigation

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Find safe navigation in HTML templates
  2. Find safe navigation in inline templates