Skip to content

Commit

Permalink
common: Enable no-constant-binary-expression (#464)
Browse files Browse the repository at this point in the history
  • Loading branch information
edg2s authored and jdforrester committed Apr 27, 2022
1 parent 0296003 commit ad700b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions common.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"no-array-constructor": "error",
"no-bitwise": "error",
"no-caller": "error",
"no-constant-binary-expression": "error",
"no-constant-condition": [ "error", { "checkLoops": false } ],
"no-empty": [ "error", { "allowEmptyCatch": true } ],
"no-eval": "error",
Expand Down
5 changes: 4 additions & 1 deletion test/fixtures/common/invalid.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ var APP;
// eslint-disable-next-line no-tabs
name = options.bar ? upHere( id ) : id; // Wow!

// eslint-disable-next-line no-constant-binary-expression
name = options.bar ? 'truthy' : 'alsoTruthy' || 3;

// eslint-disable-next-line no-constant-condition
if ( true || options.quux ) {
if ( true ) {
name += options.quux;
// eslint-disable-next-line dot-notation, computed-property-spacing
} else if ( options['default' ] ) {
Expand Down

0 comments on commit ad700b7

Please sign in to comment.