Disallow shorthand type conversions

Proprietary

Replaces double-negation boolean shorthand !!x with an explicit Boolean(x) call, unless a declaration in the file shadows the global Boolean, or inside a with statement, whose object may supply it. 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.

io.moderne.javascript.cleanup.NoImplicitCoercion
mod run . --recipe=io.moderne.javascript.cleanup.NoImplicitCoercion

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