]> git.proxmox.com Git - pve-eslint.git/commitdiff
no-mixed-operators: do not check basic math precedence
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 6 Jun 2020 14:41:35 +0000 (16:41 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 6 Jun 2020 14:41:45 +0000 (16:41 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/app.js

index 34749b1d5c22e178955fa22ba97008d2b0f83854..e366585486a40f54142763ad102a7f6220fa0318 100644 (file)
@@ -207,7 +207,16 @@ const defaultConfig = {
        "max-len": ["warn", { code: 110, tabWidth: 8, ignoreComments: true, ignoreStrings: true, ignoreRegExpLiterals: true }],
        "no-array-constructor": "warn",
        "no-lonely-if": "warn",
-       "no-mixed-operators": "warn",
+       "no-mixed-operators": ["warn", {
+           "groups": [
+               //["+", "-", "*", "/", "%", "**"], // assume the devs can do basic math..
+               ["&", "|", "^", "~", "<<", ">>", ">>>"],
+               ["==", "!=", "===", "!==", ">", ">=", "<", "<="],
+               ["&&", "||"],
+               ["in", "instanceof"]
+           ],
+           "allowSamePrecedence": true
+       }],
        "no-multiple-empty-lines": "warn",
        "no-trailing-spaces": "warn",
        // "no-underscore-dangle": ["warn", { allowAfterThis: true }], // we use it for unused variables, like in rust