瀏覽代碼

Add no-constant-binary-expression eslint rule

https://eslint.org/blog/2022/07/interesting-bugs-caught-by-no-constant-binary-expression/
Chocobozzz 5 月之前
父節點
當前提交
c37b19ffa9
共有 2 個文件被更改,包括 5 次插入1 次删除
  1. 3 0
      .eslintrc.json
  2. 2 1
      client/.eslintrc.json

+ 3 - 0
.eslintrc.json

@@ -40,6 +40,9 @@
       }
     ],
     "quotes": "off",
+
+    "no-constant-binary-expression": "error",
+
     "@typescript-eslint/indent": [
       "error",
       2,

+ 2 - 1
client/.eslintrc.json

@@ -159,7 +159,8 @@
         "quote-props": [
           "error",
           "consistent-as-needed"
-        ]
+        ],
+        "no-constant-binary-expression": "error"
       }
     },
     {