@putout/plugin-simplify-logical-expressions

putout plugin adds ability to simplify logical expressions

Usage no npm install needed!

<script type="module">
  import putoutPluginSimplifyLogicalExpressions from 'https://cdn.skypack.dev/@putout/plugin-simplify-logical-expressions';
</script>

README

@putout/plugin-simplify-logical-expressions NPM version Dependency Status

putout plugin adds ability to simplify logical-expressions.

Install

npm i @putout/plugin-simplify-logical-expressions -D

Rule

{
    "rules": {
        "simplify-logical-expressions": "on"
    }
}

❌ Incorrect code example

const is = !(options && !options.bidirectional);

if (!left.type === 'UnaryExpression');

✅ Correct code Example

const is = !options || options.bidirectional;

if (left.type !== 'UnaryExpression');

License

MIT