From 3da4dc71f1fc8470ce6c6535dbe13db697edff27 Mon Sep 17 00:00:00 2001 From: andrew rumble Date: Fri, 13 Sep 2024 13:40:52 +0100 Subject: [PATCH] Modify no-unused-vars behaviour using @typescript-eslint/no-unused-vars reduces the number of false positives in TS code. The changes: 1. Allow the arguments to a function to be checked (reporting only after the last used variable) 2. Allow rest siblings to be checked 3. Allow these rules to be skipped with an _ prefix to a variable GitOrigin-RevId: 1f6eac4109859415218248d5b2068a22b34cfd7e --- services/web/.eslintrc.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/services/web/.eslintrc.js b/services/web/.eslintrc.js index 2fa9e8f547..ef3cf11de5 100644 --- a/services/web/.eslintrc.js +++ b/services/web/.eslintrc.js @@ -383,6 +383,18 @@ module.exports = { 'Modify location via customLocalStorage instead of calling window.localStorage methods directly', }, ], + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': [ + 'error', + { + args: 'after-used', + argsIgnorePattern: '^_', + ignoreRestSiblings: false, + caughtErrors: 'none', + vars: 'all', + varsIgnorePattern: '^_', + }, + ], }, }, {