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
|[no-ignored-error](docs/rules/no-ignored-error.md)| Disallow calling `subscribe` without specifying an error handler. |||| 💭 ||
83
-
|[no-ignored-notifier](docs/rules/no-ignored-notifier.md)| Disallow observables not composed from the `repeatWhen` or `retryWhen` notifier. | ✅ ||| 💭 ||
84
-
|[no-ignored-observable](docs/rules/no-ignored-observable.md)| Disallow ignoring observables returned by functions. |||| 💭 ||
85
-
|[no-ignored-replay-buffer](docs/rules/no-ignored-replay-buffer.md)| Disallow using `ReplaySubject`, `publishReplay` or `shareReplay` without specifying the buffer size. | ✅ |||||
86
-
|[no-ignored-subscribe](docs/rules/no-ignored-subscribe.md)| Disallow calling `subscribe` without specifying arguments. |||| 💭 ||
87
-
|[no-ignored-subscription](docs/rules/no-ignored-subscription.md)| Disallow ignoring the subscription returned by `subscribe`. |||| 💭 ||
88
-
|[no-ignored-takewhile-value](docs/rules/no-ignored-takewhile-value.md)| Disallow ignoring the value within `takeWhile`. | ✅ |||||
|[no-ignored-default-value](docs/rules/no-ignored-default-value.md)| Disallow using `firstValueFrom`, `lastValueFrom`, `first`, and `last` without specifying a default value. |||| 💭 ||
83
+
|[no-ignored-error](docs/rules/no-ignored-error.md)| Disallow calling `subscribe` without specifying an error handler. |||| 💭 ||
84
+
|[no-ignored-notifier](docs/rules/no-ignored-notifier.md)| Disallow observables not composed from the `repeatWhen` or `retryWhen` notifier. | ✅ ||| 💭 ||
85
+
|[no-ignored-observable](docs/rules/no-ignored-observable.md)| Disallow ignoring observables returned by functions. |||| 💭 ||
86
+
|[no-ignored-replay-buffer](docs/rules/no-ignored-replay-buffer.md)| Disallow using `ReplaySubject`, `publishReplay` or `shareReplay` without specifying the buffer size. | ✅ |||||
87
+
|[no-ignored-subscribe](docs/rules/no-ignored-subscribe.md)| Disallow calling `subscribe` without specifying arguments. |||| 💭 ||
88
+
|[no-ignored-subscription](docs/rules/no-ignored-subscription.md)| Disallow ignoring the subscription returned by `subscribe`. |||| 💭 ||
89
+
|[no-ignored-takewhile-value](docs/rules/no-ignored-takewhile-value.md)| Disallow ignoring the value within `takeWhile`. | ✅ |||||
# Disallow using `firstValueFrom`, `lastValueFrom`, `first`, and `last` without specifying a default value (`rxjs-x/no-ignored-default-value`)
2
+
3
+
💭 This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).
4
+
5
+
<!-- end auto-generated rule header -->
6
+
7
+
This rule prevents `EmptyError` rejections if there were no emissions from `firstValueFrom`, `lastValueFrom`, `first`, or `last` by requiring `defaultValue`.
8
+
9
+
## Rule details
10
+
11
+
Examples of **incorrect** code for this rule:
12
+
13
+
```ts
14
+
import { Subject, firstValueFrom } from"rxjs";
15
+
16
+
const sub =newSubject();
17
+
const result =firstValueFrom(sub);
18
+
sub.complete();
19
+
```
20
+
21
+
Examples of **correct** code for this rule:
22
+
23
+
```ts
24
+
import { Subject, firstValueFrom } from"rxjs";
25
+
26
+
const sub =newSubject();
27
+
const result =firstValueFrom(sub, { defaultValue: null });
0 commit comments