Skip to content

Commit 2195b74

Browse files
docs(ban-observables): when not to use it
1 parent 52afdd3 commit 2195b74

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

docs/rules/ban-observables.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22

33
<!-- end auto-generated rule header -->
44

5-
This rule can be configured so that developers can ban any observable creators they want to avoid in their project.
5+
It can sometimes be useful to ban specific `rxjs` imports.
6+
This rule can be configured to ban a list of specific `rxjs` imports developers want to avoid in their project.
7+
8+
> [!TIP]
9+
> `ban-observables` only bans at the _import_ site. (In fact, it can ban anything imported from `rxjs`.)
10+
> See [`ban-operators`](./ban-operators.md) for banning operators at their _usage_.
611
712
## Options
813

9-
This rule accepts a single option which is an object the keys of which are the names of observable factory functions and the values are either booleans or strings containing the explanation for the ban.
14+
This rule accepts a single option which is an object the keys of which are the names of anything in `rxjs` and the values are either booleans or strings containing the explanation for the ban.
1015

1116
The following configuration bans `partition` and `onErrorResumeNext`:
1217

@@ -22,3 +27,16 @@ The following configuration bans `partition` and `onErrorResumeNext`:
2227
]
2328
}
2429
```
30+
31+
## When Not To Use It
32+
33+
If you have no need to ban importing anything from `rxjs`, you don't need this rule.
34+
35+
## Related To
36+
37+
- [`ban-operators`](./ban-operators.md)
38+
39+
## Resources
40+
41+
- [Rule source](https://github.com/JasonWeinzierl/eslint-plugin-rxjs-x/blob/main/src/rules/ban-observables.ts)
42+
- [Test source](https://github.com/JasonWeinzierl/eslint-plugin-rxjs-x/blob/main/tests/rules/ban-observables.test.ts)

0 commit comments

Comments
 (0)