Skip to content

Commit 6a48006

Browse files
committed
chore: Add docs and readme link
1 parent c61d288 commit 6a48006

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ Rules marked with ✅ are recommended and rules marked with 🔧 have fixers.
104104
| [`no-subject-unsubscribe`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-subject-unsubscribe.md) | Forbids calling the `unsubscribe` method of a subject instance. || |
105105
| [`no-subject-value`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-subject-value.md) | Forbids accessing the `value` property of a `BehaviorSubject` instance. | | |
106106
| [`no-subscribe-handlers`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-subscribe-handlers.md) | Forbids the passing of handlers to `subscribe`. | | |
107+
| [`no-subscribe-in-pipe`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-subscribe-in-pipe.md) | Forbids the calling of `subscribe` within any operator inside a `pipe` operation. || |
107108
| [`no-topromise`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-topromise.md) | Forbids the use of the `toPromise` method. | | |
108109
| [`no-unbound-methods`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-unbound-methods.md) | Forbids the passing of unbound methods. || |
109110
| [`no-unsafe-catch`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-unsafe-catch.md) | Forbids unsafe `catchError` usage in effects and epics. | | |

docs/rules/no-subscribe-in-pipe.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Avoid `subscribe` calls inside `pipe` operators (`no-subscribe-in-pipe`)
2+
3+
This rule effects failures if `subscribe` is called within any operator inside a `pipe` operation.
4+
5+
## Rule details
6+
7+
Examples of **incorrect** code for this rule:
8+
9+
```ts
10+
import { of } from "rxjs";
11+
import { map } from "rxjs/operators";
12+
13+
of(42, 54).pipe(
14+
map(value => {
15+
of(value).subscribe(console.log); // This will trigger the rule
16+
return value * 2;
17+
})
18+
).subscribe(result => console.log(result));
19+
```
20+
21+
Examples of **correct** code for this rule:
22+
23+
```ts
24+
import { of } from "rxjs";
25+
import { map, tap } from "rxjs/operators";
26+
27+
of(42, 54).pipe(
28+
tap(value => console.log(value)),
29+
map(value => value * 2)
30+
).subscribe(result => console.log(result));
31+
```
32+
33+
## Options
34+
35+
This rule has no options.

0 commit comments

Comments
 (0)