Disallow shorthand type conversions

Proprietary

Replaces 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.NoImplicitCoercion
mod run . --recipe=org.openrewrite.javascript.cleanup.NoImplicitCoercion

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