Simplify boolean literal comparisons
ProprietaryRemoves redundant comparisons against boolean literals. For example, x === true becomes x and x === false becomes !x. Handles both strict (===/!==) and loose (==/!=) equality, where the operand is a boolean by construction, such as a comparison. In TypeScript, an operand only typed boolean may still be undefined, so for one x !== true becomes !x, and x === true becomes x only where the result is tested for truthiness. In JavaScript, where nothing enforces an inferred boolean type, such an operand is left unchanged.
io. moderne. javascript. cleanup. SimplifyBooleanLiteralmod run . --recipe= io. moderne. javascript. cleanup. SimplifyBooleanLiteralInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.