Disallow shorthand type conversions
ProprietaryReplaces 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. NoImplicitCoercionmod run . --recipe= io. moderne. javascript. cleanup. NoImplicitCoercionInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.