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
This commit is contained in:
andrew rumble
2024-09-13 13:40:52 +01:00
committed by Copybot
parent 312664bd2d
commit 3da4dc71f1
+12
View File
@@ -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: '^_',
},
],
},
},
{