From 830be18b901f066c9fce3fdfcbd8e268c50210d5 Mon Sep 17 00:00:00 2001 From: matt burnett Date: Tue, 3 Jun 2025 22:05:26 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=8F=20chore:=20Update=20ESLint=20Rules?= =?UTF-8?q?=20for=20Unused=20Variables=20(#7719)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eslint.config.mjs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 7262ddb054..03f0a81b5e 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -121,9 +121,14 @@ export default [ // common rules 'no-nested-ternary': 'warn', 'no-constant-binary-expression': 'warn', - // Also disable the core no-unused-vars rule globally. - 'no-unused-vars': 'warn', - + 'no-unused-vars': [ + 'warn', + { + argsIgnorePattern: '^_', + varsIgnorePattern: '^_', + caughtErrorsIgnorePattern: '^_', + }, + ], 'no-console': 'off', 'import/no-cycle': 'error', 'import/no-self-import': 'error', @@ -181,9 +186,6 @@ export default [ files: ['api/**/*.js', 'config/**/*.js'], rules: { // API - // TODO: maybe later to error. - 'no-unused-const': 'off', - 'no-unused-vars': 'off', 'no-async-promise-executor': 'off', }, }, @@ -278,7 +280,14 @@ export default [ ], // '@typescript-eslint/no-unused-expressions': 'off', - '@typescript-eslint/no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': [ + 'warn', + { + argsIgnorePattern: '^_', + varsIgnorePattern: '^_', + caughtErrorsIgnorePattern: '^_', + }, + ], '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-unnecessary-condition': 'off', '@typescript-eslint/strict-boolean-expressions': 'off',