Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upNew rule: no bitwise operators on non integers #1042
Comments
This comment has been minimized.
This comment has been minimized.
|
Sounds very good! |
This comment has been minimized.
This comment has been minimized.
stale
bot
commented
May 10, 2018
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
stale
bot
added
stale
and removed
stale
labels
May 10, 2018
feross
added
the
enhancement
label
May 20, 2018
This comment has been minimized.
This comment has been minimized.
|
Reposting the comment I wrote on the PR for this issue: @tom-sherman I appreciate the idea behind this PR, but I don't think we should disallow bitwise operators when used with numbers or in the case that @LinusU mentioned: fs.access(path.join(TMP, name), fs.R_OK | fs.W_OK, function (err) {If you can add an exception to ESLint that scopes this rule sufficiently down to the cases we actually want to target, then I'm happy to consider this change! In the meantime, I'm going to close this issue since we can't enable this rule without an upstream change from ESLint. Please post a comment here and I will re-open this issue, once there's an issue or PR filed with ESLint. |
tom-sherman commentedJan 12, 2018
I came across an error in my code where I typed
'string' | binstead of'string' || b.These bitwise operators only make sense on integers and a rule to catch this would have saved me a bit of time!
What are thoughts around a rule that disallows any string or object literal symbols in these scenarios?