Disallow shorthand type conversions
ProprietaryReplaces double-negation boolean shorthand !!x with an explicit Boolean(x) call. Other shorthand coercions flagged by the ESLint rule (+x, x * 1, "" + x, ~x.indexOf(y)) are intentionally left unchanged because their rewrites can change program semantics. Replicates the autofix of the ESLint rule no-implicit-coercion under its default options.
org. openrewrite. javascript. cleanup. NoImplicitCoercionmod run . --recipe= org. openrewrite. javascript. cleanup. NoImplicitCoercionInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.