Skip to content

Commit

Permalink
Allow unused catch error variables
Browse files Browse the repository at this point in the history
We use try catch blocks to handle rejected promises in
async await functions. Eslint forces us to have the error
variable but the typescript linter throws an error that
they're unused.
  • Loading branch information
Abban committed Sep 5, 2024
1 parent 2683f7e commit 63197f0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ module.exports = {

// problematic in TypeScript / ES6
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-unused-vars': [ 'error', {
'args': 'after-used',
'argsIgnorePattern': '^_',
'caughtErrors': 'none',
'caughtErrorsIgnorePattern': '^_',
'destructuredArrayIgnorePattern': '^_',
'varsIgnorePattern': '^_',
'ignoreRestSiblings': true,
} ],
'one-var': 'off',
'no-undef': 'off',
// See https://stackoverflow.com/a/65768375/130121
Expand Down

0 comments on commit 63197f0

Please sign in to comment.