@putout/plugin-convert-comparison-to-boolean

putout plugin adds ability to convert comparison to boolean

Usage no npm install needed!

<script type="module">
  import putoutPluginConvertComparisonToBoolean from 'https://cdn.skypack.dev/@putout/plugin-convert-comparison-to-boolean';
</script>

README

@putout/plugin-convert-comparison-to-boolean NPM version Dependency Status

putout plugin adds ability to find and convert binary expression to boolean.

Install

npm i @putout/plugin-convert-comparison-to-boolean -D

Rule

{
    "rules": {
        "convert-comparison-to-boolean": "on"
    }
}

❌ Incorrect code example

const t = 2 < 3;

✅ Correct code Example

const t = false;

License

MIT