Disallow if statements as the only statement in else blocks
ProprietaryCollapses an else block that contains nothing but an if statement into an else if. For example, else { if (b) { g(); } } becomes else if (b) { g(); }. Replicates the autofix of the ESLint rule no-lonely-if under its default options.
org. openrewrite. javascript. cleanup. NoLonelyIfmod run . --recipe= org. openrewrite. javascript. cleanup. NoLonelyIfInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.