Skip to content

Commit 2ebad97

Browse files
author
Eric Wheeler
committed
feat: Add no-useless-catch ESLint rule
Enforce the `no-useless-catch` ESLint rule across the codebase. This rule disallows `catch` clauses that only rethrow the caught error, which provides no additional value and can make debugging harder. This change adds the rule as an "error" to: - The root ESLint configuration ([](/.eslintrc.json)) - The webview UI ESLint configuration ([](webview-ui/.eslintrc.json)) This ensures that all `catch` blocks either handle the error meaningfully or are omitted if the error should propagate. Signed-off-by: Eric Wheeler <[email protected]>
1 parent 277a309 commit 2ebad97

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default [
1212

1313
"no-empty": "error",
1414
"no-implicit-coercion": "error",
15+
"no-useless-catch": "error",
1516

1617
"@typescript-eslint/no-unused-vars": "off",
1718
"@typescript-eslint/no-explicit-any": "off",

webview-ui/eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default [
2020
"react/display-name": "off",
2121
"no-empty": "error",
2222
"no-implicit-coercion": "error",
23+
"no-useless-catch": "error",
2324
},
2425
},
2526
{

0 commit comments

Comments
 (0)