Rule to enforce parameter type declaration of unknown
for catchError()
#49
Labels
enhancement
New feature or request
unknown
for catchError()
#49
The time has finally come that TypeScript v4 added the ability to explicitly declare
catch
bindings asunknown
instead ofany
and the next version oftypescript-eslint
will come with a rule to enforce the usage ofunknown
for allcatch
clauses, finally making them type safe.The only puzzle piece missing then is the same for
catchError()
bindings in Rx. These areany
in the typings by default (the same as with TypeScript v4'scatch
clauses), but them beingany
, they can be manually declared to beunknown
instead. It would be awesome to have a rule that enforces this, with an autofixer. It should also forbid any other types to be used (those can be explicitly casted if needed).The text was updated successfully, but these errors were encountered: