]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/docs/src/rules/no-constant-binary-expression.md
import 8.41.0 source
[pve-eslint.git] / eslint / docs / src / rules / no-constant-binary-expression.md
index 43deeae7008a52146fc2ff59931314df99d5f796..792c61d529db8dea36e53dd98e04a1aa31ba9793 100644 (file)
@@ -1,6 +1,5 @@
 ---
 title: no-constant-binary-expression
-layout: doc
 rule_type: problem
 related_rules:
 - no-constant-condition
@@ -54,6 +53,12 @@ const value4 = new Boolean(foo) === true;
 const objIsEmpty = someObj === {};
 
 const arrIsEmpty = someArr === [];
+
+const shortCircuit1 = condition1 && false && condition2;
+
+const shortCircuit2 = condition1 || true || condition2;
+
+const shortCircuit3 = condition1 ?? "non-nullish" ?? condition2;
 ```
 
 :::