From 8c0448f9080ca0f2bdb06d0a413433d19ef675da Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 13 Jun 2023 14:51:33 +0200 Subject: [PATCH 1/6] Update '.ts-eslintrc.json' --- .ts-eslintrc.json | 48 +++++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/.ts-eslintrc.json b/.ts-eslintrc.json index 52f270c..84aec5e 100644 --- a/.ts-eslintrc.json +++ b/.ts-eslintrc.json @@ -1,7 +1,9 @@ { + "plugins": ["jest", "@typescript-eslint"], "env": { "es6": true, - "node": true + "node": true, + "jest/globals": true }, "extends": [ "eslint:recommended", "plugin:@typescript-eslint/recommended" ], "globals": { @@ -9,23 +11,24 @@ "SharedArrayBuffer": "readonly" }, "parser": "@typescript-eslint/parser", - "plugins": [ "@typescript-eslint" ], "parserOptions": { "ecmaVersion": 2022, "sourceType": "module" }, "rules": { + "@typescript-eslint/no-unused-vars": "off", "accessor-pairs": "warn", "array-callback-return": "warn", - "array-bracket-newline": [ "warn", "consistent" ], - "array-bracket-spacing": [ "warn", "always", { "objectsInArrays": false, "arraysInArrays": false }], + "array-bracket-newline": ["warn", "consistent"], + "array-bracket-spacing": ["warn", "always", { "objectsInArrays": false, "arraysInArrays": false }], + // "arrow-parens": "warn", "arrow-spacing": "warn", "block-scoped-var": "warn", - "block-spacing": [ "warn", "always" ], - "brace-style": [ "warn", "1tbs" ], + "block-spacing": ["warn", "always"], + "brace-style": ["warn", "1tbs"], "callback-return": "warn", "camelcase": "warn", - "comma-dangle": [ "warn", "only-multiline" ], + "comma-dangle": ["warn", "only-multiline"], "comma-spacing": [ "warn", { @@ -68,9 +71,9 @@ "implicit-arrow-linebreak": "warn", "indent": "warn", "init-declarations": "warn", - "jsx-quotes": [ "warn", "prefer-single" ], - "key-spacing": [ "warn", { "beforeColon": false, "afterColon": true }], - "keyword-spacing": [ "warn", { "after": true, "before": true }], + "jsx-quotes": ["warn", "prefer-single"], + "key-spacing": ["warn", { "beforeColon": false, "afterColon": true }], + "keyword-spacing": ["warn", { "after": true, "before": true }], "linebreak-style": [ "error", "unix" @@ -79,6 +82,16 @@ "lines-around-directive": "warn", "max-classes-per-file": "warn", "max-nested-callbacks": "warn", + "max-len": ["warn", { + "code": 140, + "ignoreComments": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreRegExpLiterals": true + }], + + "max-lines-per-function": ["warn", 100], + "max-depth": ["warn", 3], "new-parens": "warn", "no-alert": "warn", "no-array-constructor": "warn", @@ -96,7 +109,6 @@ "no-extend-native": "warn", "no-extra-bind": "warn", "no-extra-label": "warn", - "no-extra-parens": "warn", "no-floating-decimal": "warn", "no-implicit-coercion": "warn", "no-implicit-globals": "warn", @@ -138,7 +150,7 @@ "no-sequences": "warn", "no-setter-return": "warn", "no-spaced-func": "warn", - "@typescript-eslint/no-shadow": "error", + "no-shadow": "error", "no-tabs": "warn", "no-template-curly-in-string": "error", "no-throw-literal": "warn", @@ -157,18 +169,18 @@ "no-var": "warn", "no-void": "warn", "no-whitespace-before-property": "error", - "nonblock-statement-body-position": [ "warn", "below" ], + "nonblock-statement-body-position": ["warn", "below"], "object-curly-spacing": [ "warn", "always" ], - "object-property-newline": [ "warn", { "allowAllPropertiesOnSameLine": true }], + "object-property-newline": ["warn", { "allowAllPropertiesOnSameLine": true }], "object-shorthand": "warn", "one-var-declaration-per-line": "warn", "operator-assignment": "warn", - "operator-linebreak": [ "warn", "before" ], + "operator-linebreak": ["warn", "before"], "padding-line-between-statements": "warn", - "padded-blocks": [ "warn", { "switches": "never" }, { "allowSingleLineBlocks": true }], + "padded-blocks": ["warn", { "switches": "never" }, { "allowSingleLineBlocks": true }], "prefer-arrow-callback": "warn", "prefer-const": "warn", "prefer-destructuring": "warn", @@ -189,12 +201,12 @@ "last" ], "space-before-blocks": "warn", - "space-before-function-paren": [ "error", "always" ], + "space-before-function-paren":["error", "always"], "space-in-parens": [ "warn", "never" ], - "spaced-comment": [ "warn", "always" ], + "spaced-comment": ["warn", "always"], "strict": "warn", "switch-colon-spacing": "warn", "symbol-description": "warn", From 1e73bc0d29b6795ca37ee2169bbd15d6fa5b6e93 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 14 Jun 2023 16:34:48 +0200 Subject: [PATCH 2/6] Update '.ts-eslintrc.json' --- .ts-eslintrc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ts-eslintrc.json b/.ts-eslintrc.json index 84aec5e..63dd0c6 100644 --- a/.ts-eslintrc.json +++ b/.ts-eslintrc.json @@ -150,7 +150,7 @@ "no-sequences": "warn", "no-setter-return": "warn", "no-spaced-func": "warn", - "no-shadow": "error", + "@typescript-eslint/no-shadow": "error", "no-tabs": "warn", "no-template-curly-in-string": "error", "no-throw-literal": "warn", From 09e92946f8aeb6b6221d88d91e9f5caed3a8cb51 Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 14 Jun 2023 22:35:55 +0200 Subject: [PATCH 3/6] Update '.ts-eslintrc.json' --- .ts-eslintrc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ts-eslintrc.json b/.ts-eslintrc.json index 63dd0c6..ad915f5 100644 --- a/.ts-eslintrc.json +++ b/.ts-eslintrc.json @@ -159,7 +159,7 @@ "no-unmodified-loop-condition": "warn", "no-unneeded-ternary": "error", "no-unused-expressions": "warn", - "no-use-before-define": "error", + "@typescript-eslint/no-use-before-define": "error", "no-useless-call": "warn", "no-useless-computed-key": "warn", "no-useless-concat": "warn", From 04a184822bf0d060bc749c30400726d9db1188ab Mon Sep 17 00:00:00 2001 From: Erik Date: Wed, 14 Jun 2023 22:45:23 +0200 Subject: [PATCH 4/6] Update '.ts-eslintrc.json' --- .ts-eslintrc.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.ts-eslintrc.json b/.ts-eslintrc.json index ad915f5..bfa02f5 100644 --- a/.ts-eslintrc.json +++ b/.ts-eslintrc.json @@ -71,6 +71,7 @@ "implicit-arrow-linebreak": "warn", "indent": "warn", "init-declarations": "warn", + "quotes": ["error" , "single"], "jsx-quotes": ["warn", "prefer-single"], "key-spacing": ["warn", { "beforeColon": false, "afterColon": true }], "keyword-spacing": ["warn", { "after": true, "before": true }], From cb1d604853b0596170e6f95b300a12e5d865468b Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 9 Nov 2023 13:01:16 +0100 Subject: [PATCH 5/6] added new rule --- .ts-eslintrc.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.ts-eslintrc.json b/.ts-eslintrc.json index bfa02f5..dc4a4e3 100644 --- a/.ts-eslintrc.json +++ b/.ts-eslintrc.json @@ -100,6 +100,7 @@ "no-buffer-constructor": "warn", "no-caller": "warn", "no-console": "warn", + "no-constant-binary-expression": "error", "no-div-regex": "warn", "no-dupe-else-if": "warn", "no-duplicate-imports": "warn", From 697c039b6873fbca4e97b13500d58039b819b058 Mon Sep 17 00:00:00 2001 From: Erik Date: Thu, 9 Nov 2023 13:01:36 +0100 Subject: [PATCH 6/6] new rule --- .eslintrc.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc.json b/.eslintrc.json index cb83720..4b5a4bf 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -91,6 +91,7 @@ "no-buffer-constructor": "warn", "no-caller": "warn", "no-console": "warn", + "no-constant-binary-expression": "error", "no-div-regex": "warn", "no-dupe-else-if": "warn", "no-duplicate-imports": "warn",