From 7986828f6c545e683e133fee42691588554c9a36 Mon Sep 17 00:00:00 2001 From: regexowl Date: Thu, 16 Jan 2025 12:02:31 +0100 Subject: [PATCH] ESLint: Set "no-unnecessary-condition" rule to warn This adds "no-unnecessary-condition" and sets the output to warn. This should help us eliminate superfluous conditional chaining and uncover potentially faulty conditions. Docs: https://typescript-eslint.io/rules/no-unnecessary-condition/ --- .eslintrc.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.eslintrc.yml b/.eslintrc.yml index 0896d7c10..10ca35aba 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -13,6 +13,8 @@ globals: render: 'readonly' mount: 'readonly' parser: "@typescript-eslint/parser" +parserOptions: + project: ["tsconfig.json"] plugins: - import rules: @@ -49,6 +51,7 @@ rules: ts-check: true minimumDescriptionLength: 5 "@typescript-eslint/ban-types": off + "@typescript-eslint/no-unnecessary-condition": warn # Temporarily disabled jsx-a11y/no-autofocus: off rulesdir/forbid-pf-relative-imports: off