During the development of our TypeScript application, we have been utilizing the "noImplicitAny" compiler option in tsconfig.json:
"noImplicitAny": true
As we delve deeper into error handling, we came across the following insights:
How do you use typed errors in async catch()
and also:
https://github.com/Microsoft/TypeScript/issues/8677#issuecomment-220385124
The rationale for not allowing type annotations on catch clauses is that it's challenging to predict the type of an exception. Exceptions can be of various types and unexpected system-generated exceptions could occur at any point.
It seems like there are limitations when it comes to typing errors.
We experimented with the "suppressImplicitAnyIndexErrors": true option but unfortunately, it did not resolve the build error:
Parameter 'error' implicitly has an 'any' type
Although we prefer not to enable this setting to prevent careless casting, implementing proper exception handling is crucial. Is there an alternative approach or workaround that allows us to handle errors effectively while maintaining the "noImplicitAny" option in TypeScript?