You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(no-misused-observables): false positive for JSX attributes (#239)
Missed corner case from the original implementation of this rule when
imitating `no-misused-promises`.
We didn't add unit tests for the non-void case, so this was triggering
the rule:
```tsx
import { Observable, of } from "rxjs";
interface Props {
foo: () => Observable<number>;
}
declare function Component(props: Props): any;
const _ = <Component foo={() => of(42)} />;
```
essentially blocking _any_ prop from ever being an Observable-returning
function. We need to check if the contextual type of the prop is
void-returning _and_ if the expression returns an Observable before
reporting a violation.
0 commit comments