eslint/no-bitwise Restriction
What it does
Disallow bitwise operators
Why is this bad?
The use of bitwise operators in JavaScript is very rare and often &
or |
is simply a mistyped &&
or ||
, which will lead to unexpected behavior.
Example
javascript
var x = y | z;
How to use
To enable this rule in the CLI or using the config file, you can use:
bash
oxlint --deny no-bitwise
json
{
"rules": {
"no-bitwise": "error"
}
}