From 3655777db7b3fbfdcce4f2487b77b3ae4027f76a Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 13 Dec 2020 11:46:32 +0100 Subject: [PATCH] Enable the ESLint `no-unsafe-optional-chaining` rule Given that we're using optional chaining in the code-base, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining, it can't hurt to add this ESLint rule to help catch one possible source of bugs when using optional chaining expressions. Please find additional details about the ESLint rule at https://eslint.org/docs/rules/no-unsafe-optional-chaining --- .eslintrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc b/.eslintrc index e06d92908..7ad4fa257 100644 --- a/.eslintrc +++ b/.eslintrc @@ -67,6 +67,7 @@ "no-unreachable": "error", "no-unsafe-finally": "error", "no-unsafe-negation": "error", + "no-unsafe-optional-chaining": ["error", { "disallowArithmeticOperators": true }], "use-isnan": ["error", { "enforceForIndexOf": true, }], "valid-typeof": ["error", { "requireStringLiterals": true, }],