Closed yuwu9145 closed 3 years ago
Given that TSLint was deprecated some time ago and that the TSLint repo is now archived. I do not plan on adding any additional features/rules to rxjs-tslint-rules
.
Beyond that, I'm not sure that a rule that enforces the presence of catchError
in all observables would be something that I would want to implement or encourage people to use. While it might be well intentioned, I think that it would be awkward in practice, as observables are often composed from other observables and where the catchError
should be placed isn't straightforward. There is also the issue that files are linted one by one and what if an observable in one file doesn't have a catchError
, but is never subscribed to directly and is instead composed into observable chains in other files?
HI @cartant ,
Thanks for your comprehensive explain.
The problem for our team is not everyone wants to construct error handler for http request observable failures, and unhandled http fail status like 400, 500 would cause dead front end UI, which is why we want to have a lint rule to enforce http fail handling. We have centralised all these http request observables into certain files. I guess realistically we could firstly construct our own lint rule applied to these http observable files and see how does it go.
Hi,
In our project, we want to enforce every observable to have catchError operator by default. Would this rule be worth adding into this package?
Thanks