Skip to content

Commit 9111731

Browse files
committedJul 1, 2022
Add no-constant-binary-expression
1 parent 6664dbe commit 9111731

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed
 

‎README.md

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Then add a `.eslintrc` with the following:
5454

5555
* :warning: [`func-style`](https://eslint.org/docs/rules/func-style) – disallows function declarations, good to be consistent with how functions are declared
5656
* :warning: [`no-console`](https://eslint.org/docs/rules/no-console) – warns on existence of `console.log` and similar, as they are mostly used for debugging and should not be committed
57+
* :stop_sign: [`no-constant-binary-expression`](https://eslint.org/docs/rules/no-constant-binary-expression) – errors when binary expressions are detected to constantly evaluate a specific way
5758
* :stop_sign: [`no-nonoctal-decimal-escape`](https://eslint.org/docs/rules/no-nonoctal-decimal-escape) – there's no reason not to ban it
5859
* :stop_sign: [`no-unsafe-optional-chaining`](https://eslint.org/docs/rules/no-unsafe-optional-chaining) – enforces one to be careful with `.?` and not use it in ways that can inadvertently cause errors or `NaN` results
5960
* :warning: [`no-warning-comments`](https://eslint.org/docs/rules/no-warning-comments) – warns of the existence of `FIXME` comments, as they should always be fixed before pushing

‎eslintrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848

4949
"func-style": ["warn", "expression", { "allowArrowFunctions": true }],
5050
"no-console": "warn",
51+
"no-constant-binary-expression": "error",
5152
"no-unsafe-optional-chaining": ["error", { "disallowArithmeticOperators": true }],
5253
"no-warning-comments": ["warn", { "terms": ["fixme"] }],
5354
"object-shorthand": ["error", "properties", { "avoidQuotes": true }],

0 commit comments

Comments
 (0)
Please sign in to comment.