Open osltest opened 2 years ago
Just ran into the same issue. The rule is excellent and has prevented us from obvious programming mistakes for a long while, but with the old subscribe signature deprecated, we basically lost this safeguard.
Unfortunately I lack the skills to provide a fix.
One more cornerstone about rxjs/no-ignored-error
rule is that is doesn't work if we just call .subscribe()
with no arguments.
// ESLint: Calling subscribe without an error handler is forbidden.(rxjs/no-ignored-error)
obs$.subscribe((x) => x);
// BUT
// This line is ok for the linter, which is not what i expect
obs$.subscribe();
According to the description the no-ignored-error rule should produce an error for both way to handle a subsciption. For this way it works as expected:
But when using
next
like below no eslint error is given:Simple code to reproduce:
My .eslintrc.js config: