This rule prevents the use of explicit type arguments when the type arguments can be inferred.
Examples of incorrect code for this rule:
import { BehaviorSubject } from "rxjs";
const subject = new BehaviorSubject<number>(42);
Examples of correct code for this rule:
import { BehaviorSubject } from "rxjs";
const subject = new BehaviorSubject(42);
This rule has known problems in the latest release:
- (#77) Type unions cause false positives e.g.
new BehaviorSubject<number | null>(null)
will be incorrectly caught by this rule.