update dependencies and code #1032
Merged
+4,090
−4,176
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the usual dependency update before a release (scheduled to be the v3.26.2).
After updating
typescript-eslint
, new linter errors made their apparitions, for cases where anany
type is used as a function argument (the rule in question is no-unsafe-argument).That's a rule we want (
any
is bad after all!) but RxJS, our main dependency, does not respect it well.Especially, some operators which transform an observable into another without needing to look at the items of the source Observable (e.g.
mapTo
,mergeMapTo
,switchMapTo
,ignoreElements
) have anany
in their type definition for the type of the source Observable's elements (where anunknown
would actually suffice and be type-safe).Replacing on their side this
any
byunknown
is planned for their 8.x.x release (which is not yet released). In the meantime, we had to find a solution.I chose to do two things:
Replace all the "***To" (
mapTo
,mergeMapTo
and so on) operators by their callback-based equivalent (map
,mergeMap
and so on). I did that mostly because RxJS devs seems to plan deprecating the ***To operators anyway in profit of the callback-based ones.For the last remaining operator,
ignoreElements()
, I just disabled the rule with a long comment attached on top of each case.