@putout/plugin-convert-bitwise-to-logical
🐊Putout plugin adds ability to convert bitwice to logical operator
Last updated 4 years ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @putout/plugin-convert-bitwise-to-logical 
SYNC missed versions from official npm registry.

@putout/plugin-convert-bitwise-to-logical NPM version

The bitwise OR operator (|) returns a 1 in each bit position for which the corresponding bits of either or both operands are 1s.

The operands are converted to 32-bit integers and expressed by a series of bits (zeroes and ones).

(c) MDN

????Putout plugin adds ability to convert bitwise to logical operator, when one of operands is not a number, since mostly likely it is an error. Merged to @putout/plugin-logical-expressions.

Install

npm i @putout/plugin-convert-bitwise-to-logical -D

Rule

{
    "rules": {
        "convert-bitwise-to-logical": "on"
    }
}

❌ Example of incorrect code

a | !b;

✅ Example of correct code

a || !b;

License

MIT

Current Tags

  • 1.0.1                                ...           latest (4 years ago)

2 Versions

  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (6)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |