Collapsible if statements should be merged

Proprietary

Merges nested if statements that can be combined with &&. For example, if (a) { if (b) { ... } } becomes if (a && b) { ... }. Only applies when neither if has an else clause and the outer body contains only the inner if.

org.openrewrite.javascript.cleanup.CollapsibleIfStatements
mod run . --recipe=org.openrewrite.javascript.cleanup.CollapsibleIfStatements

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