From e062c169663f20f57e3ae19bdba3c62d70c60220 Mon Sep 17 00:00:00 2001 From: Miodec Date: Tue, 20 Sep 2022 14:16:12 +0200 Subject: [PATCH] added eslint rule to protect against misused promises --- .eslintrc.json | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 9c23fd769..5ddcdd4e1 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -11,6 +11,11 @@ "ClipboardItem": "readonly", "grecaptcha": "readonly" }, + "ignorePatterns": [ + "backend/__tests__/**/*", + "backend/setup-tests.ts", + "backend/jest.config.ts" + ], "extends": [ "eslint:recommended", "plugin:json/recommended", @@ -21,7 +26,8 @@ "plugins": ["json", "require-path-exists", "@typescript-eslint"], "parserOptions": { "ecmaVersion": 12, - "sourceType": "module" + "sourceType": "module", + "project": ["./frontend/tsconfig.json", "./backend/tsconfig.json"] }, "rules": { "json/*": ["error"], @@ -57,7 +63,17 @@ ], "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-unused-vars": "off", - "@typescript-eslint/no-var-requires": "off" + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/no-misused-promises": [ + "error", + { + "checksVoidReturn": false + } + ] + // "@typescript-eslint/no-floating-promises": "error", + // "@typescript-eslint/promise-function-async": "warn", + // "@typescript-eslint/strict-boolean-expressions": "warn", + // "@typescript-eslint/no-unnecessary-condition": "warn" }, "overrides": [ {