From 7aec362225eefdfa20e3f46c0a97a36767620491 Mon Sep 17 00:00:00 2001 From: j0code <42189560+j0code@users.noreply.github.com> Date: Sat, 23 Mar 2024 21:11:45 +0100 Subject: [PATCH] Less strict eslint rules (#79) Changes: - curly: error -> off (no restrictions on {} usage on if, for, etc.) - no-console: allow "warn" and "debug" - no-mixed-operators: - allow mixing arithmetic (+-\*%\*\*) operators - disallow mixing ternary operator with some operators - no-nested-ternary: off (avoid where possible pls) - function-paren-newline: never -> multiline - max-len.comments: 120 -> 160 --- .eslintrc.json | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 2424aa6..bbfe948 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -63,7 +63,7 @@ "complexity": ["warn", 24], "consistent-return": "off", "consistent-this": ["warn", "that"], - "curly": ["error", "multi-or-nest"], + "curly": ["off", "multi-or-nest"], "default-case": "off", "default-case-last": "error", "default-param-last": "off", @@ -91,7 +91,7 @@ "no-caller": "error", "no-case-declarations": "error", "no-confusing-arrow": ["error", {"allowParens": true, "onlyOneSimpleParam": true}], - "no-console": ["error", {"allow": ["table", "group", "groupEnd", "dir"]}], + "no-console": ["error", {"allow": ["table", "group", "groupEnd", "dir", "warn", "debug"]}], "no-continue": "off", "no-delete-var": "error", "no-div-regex": "warn", @@ -120,11 +120,16 @@ "no-lonely-if": "warn", "no-loop-func": "error", "no-magic-numbers": "off", - "no-mixed-operators": ["warn"], + "no-mixed-operators": ["warn", { "groups": [ + ["&", "|", "^", "~", "<<", ">>", ">>>", "?:"], + ["==", "!=", "===", "!==", ">", ">=", "<", "<="], + ["&&", "||", "?:"], + ["in", "instanceof"] + ] }], "no-multi-assign": "off", "no-multi-str": "error", "no-negated-condition": "error", - "no-nested-ternary": "error", + "no-nested-ternary": "off", "no-new": "off", "no-new-func": "error", "no-new-object": "warn", @@ -213,7 +218,7 @@ "eol-last": ["error", "always"], "func-call-spacing": ["error", "never"], "function-call-argument-newline": ["error", "consistent"], - "function-paren-newline": ["error", "never"], + "function-paren-newline": ["error", "multiline"], "generator-star-spacing": ["warn", {"before": false, "after": true}], "implicit-arrow-linebreak": ["error", "beside"], "indent": ["error", "tab"], @@ -239,7 +244,7 @@ }], "lines-between-class-members": ["error", "always", {"exceptAfterSingleLine": true}], "max-len": ["warn", { - "code": 160, "tabWidth": 2, "comments": 120, "ignoreUrls": true + "code": 160, "tabWidth": 2, "comments": 160, "ignoreUrls": true }], "max-statements-per-line": ["error", {"max": 1}], "multiline-ternary": ["warn", "never"],