💭 This rule requires type information.
This rule effects failures whenever subscribe
is called with handlers.
Examples of incorrect code for this rule:
import { of } from "rxjs";
import { tap } from "rxjs/operators";
of(42, 54).subscribe((value) => console.log(value));
import { of } from "rxjs";
import { tap } from "rxjs/operators";
of(42, 54).subscribe({
next: (value) => console.log(value),
});
Examples of correct code for this rule:
import { of } from "rxjs";
of(42, 54)
.pipe(tap((value) => console.log(value)))
.subscribe();
If you don't require all logic to go in the pipe
section of your observables, then you don't need this rule.
Also, if your project uses no-ignored-subscribe
, which is the opposite of this rule, then you should not use this rule.
Type checked lint rules are more powerful than traditional lint rules, but also require configuring type checked linting.