From 07259ca342bdaacdda7507f6eab7d689daa82768 Mon Sep 17 00:00:00 2001 From: Yury Bondarenko Date: Wed, 28 Jun 2023 12:38:47 +0200 Subject: [PATCH] ESLint/TypeScript: enforce no-implicit-any-catch TypeScript try/catch and RxJs catchError are not type-safe. https://typescript-eslint.io/rules/no-implicit-any-catch/ https://devblogs.microsoft.com/typescript/announcing-typescript-4-0/#unknown-on-catch https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-implicit-any-catch.md --- .eslintrc.json | 1 - tsconfig.json | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 44b9e0c5ef..cb5775ef1f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -239,7 +239,6 @@ "method" ], - "rxjs/no-implicit-any-catch": "off", // todo: investigate how best to solve these "rxjs/no-nested-subscribe": "off" // todo: go over _all_ cases } }, diff --git a/tsconfig.json b/tsconfig.json index 1eed699114..4ccd727a64 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -40,7 +40,8 @@ "node", "jasmine" ], - "useDefineForClassFields": false + "useDefineForClassFields": false, + "useUnknownInCatchVariables": true }, "angularCompilerOptions": { "fullTemplateTypeCheck": true,