Require let or const instead of var
ProprietaryReplaces var declarations with let when the conversion provably preserves semantics, leaving unsafe cases (redeclarations, uses outside the would-be block scope, uses before declaration, closure captures in loops, top-level var in files that are not modules, and similar) unchanged. Replicates the autofix of the ESLint rule no-var under its default options.
org. openrewrite. javascript. cleanup. NoVarmod run . --recipe= org. openrewrite. javascript. cleanup. NoVarInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.