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
Copy file name to clipboardExpand all lines: README.md
+38-38
Original file line number
Diff line number
Diff line change
@@ -56,41 +56,41 @@ The package includes the following rules:
56
56
57
57
| Rule | Description | Recommended |
58
58
| --- | --- | --- |
59
-
|[`ban-observables`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/ban-observables.ts)| Forbids the use of banned observables. | TBD |
60
-
|[`ban-operators`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/ban-operators.ts)| Forbids the use of banned operators. | TBD |
61
-
|[`finnish`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/finnish.ts)| Enforces the use of Finnish notation. | TBD |
62
-
|[`just`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/just.ts)| Enforces the use of a `just` alias for `of`. | TBD |
63
-
|[`no-async-subscribe`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-async-subscribe.ts)| Forbids passing `async` functions to `subscribe`. | TBD |
64
-
|[`no-compat`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-compat.ts)| Forbids importation from locations that depend upon `rxjs-compat`. | TBD |
65
-
|[`no-connectable`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-connectable.ts)| Forbids operators that return connectable observables. | TBD |
66
-
|[`no-create`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-create.ts)| Forbids the calling of `Observable.create`. | TBD |
67
-
|[`no-explicit-generics`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-explicit-generics.ts)| Forbids explicit generic type arguments. | TBD |
|[`no-finnish`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-finnish.ts)| Forbids the use of Finnish notation. | TBD |
70
-
|[`no-ignored-error`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-ignored-error.ts)| Forbids the calling of `subscribe` without specifying an error handler. | TBD |
71
-
|[`no-ignored-notifier`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-ignored-notifier.ts)| Forbids observables not composed from the `repeatWhen` or `retryWhen` notifier. | TBD |
72
-
|[`no-ignored-observable`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-ignored-observable.ts)| Forbids the ignoring of observables returned by functions. | TBD |
73
-
|[`no-ignored-replay-buffer`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-ignored-replay-buffer.ts)| Forbids using `ReplaySubject`, `publishReplay` or `shareReplay` without specifying the buffer size. | TBD |
74
-
|[`no-ignored-subscribe`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-ignored-subscribe.ts)| Forbids the calling of `subscribe` without specifying arguments. | TBD |
75
-
|[`no-ignored-subscription`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-ignored-subscription.ts)| Forbids ignoring the subscription returned by `subscribe`. | TBD |
76
-
|[`no-ignored-takewhile-value`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-ignored-takewhile-value.ts)| Forbids ignoring the value within `takeWhile`. | TBD |
77
-
|[`no-implicit-any-catch`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-implicit-any-catch.ts)| Like the [`no-implicit-any-catch` rule](https://github.com/typescript-eslint/typescript-eslint/pull/2202) in `@typescript-eslint/eslint-plugin`, but for the `catchError` operator instead of `catch` clauses. | TBD |
78
-
|[`no-index`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-index.ts)| Forbids the importation from index modules - for the reason, see [this issue](https://github.com/ReactiveX/rxjs/issues/4230). | TBD |
79
-
|[`no-internal`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-internal.ts)| Forbids the importation of internals. | TBD |
80
-
|[`no-nested-subscribe`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-nested-subscribe.ts)| Forbids the calling of `subscribe` within a `subscribe` callback. | TBD |
81
-
|[`no-redundant-notify`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-redundant-notify.ts)| Disallows redundant notifications from completed or errored observables. | TBD |
82
-
|[`no-sharereplay`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-sharereplay.ts)| Forbids using the `shareReplay` operator. | TBD |
|[`no-subject-unsubscribe`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-subject-unsubscribe.ts)| Forbids calling the `unsubscribe` method of a subject instance. | TBD |
85
-
|[`no-subject-value`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-subject-value.ts)| Forbids accessing the `value` property of a `BehaviorSubject` instance. | TBD |
86
-
|[`no-tap`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-tap.ts)| Forbids the use of the `tap` operator. | TBD |
87
-
|[`no-topromise`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-topromise.ts)| Forbids the use of the `toPromise` method. | TBD |
88
-
|[`no-unbound-methods`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-unbound-methods.ts)| Forbids the passing of unbound methods. | TBD |
89
-
|[`no-unsafe-catch`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-unsafe-catch.ts)| Forbids unsafe `catchError` usage in effects and epics. | TBD |
90
-
|[`no-unsafe-first`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-unsafe-first.ts)| Forbids unsafe `first`/`take` usage in effects and epics. | TBD |
|[`no-unsafe-switchmap`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-unsafe-switchmap.ts)| Forbids unsafe `switchMap` usage in effects and epics. | TBD |
93
-
|[`no-unsafe-takeuntil`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-unsafe-takeuntil.ts)| Forbids the application of operators after `takeUntil`. | TBD |
94
-
|[`prefer-observer`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/prefer-observer.ts)| Forbids the passing separate callbacks to `subscribe` and `tap`. | TBD |
95
-
|[`suffix-subjects`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/suffix-subjects.ts)| Enforces the use of a suffix in subject identifiers. | TBD |
96
-
|[`throw-error`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/throw-error.ts)| Enforces the passing of `Error` values to error notifications. | TBD |
59
+
|[`ban-observables`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/ban-observables.md)| Forbids the use of banned observables. | TBD |
60
+
|[`ban-operators`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/ban-operators.md)| Forbids the use of banned operators. | TBD |
61
+
|[`finnish`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/finnish.md)| Enforces the use of Finnish notation. | TBD |
62
+
|[`just`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/just.md)| Enforces the use of a `just` alias for `of`. | TBD |
63
+
|[`no-async-subscribe`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-async-subscribe.md)| Forbids passing `async` functions to `subscribe`. | TBD |
64
+
|[`no-compat`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-compat.md)| Forbids importation from locations that depend upon `rxjs-compat`. | TBD |
65
+
|[`no-connectable`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-connectable.md)| Forbids operators that return connectable observables. | TBD |
66
+
|[`no-create`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-create.md)| Forbids the calling of `Observable.create`. | TBD |
67
+
|[`no-explicit-generics`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-explicit-generics.md)| Forbids explicit generic type arguments. | TBD |
|[`no-finnish`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-finnish.md)| Forbids the use of Finnish notation. | TBD |
70
+
|[`no-ignored-error`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-ignored-error.md)| Forbids the calling of `subscribe` without specifying an error handler. | TBD |
71
+
|[`no-ignored-notifier`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-ignored-notifier.md)| Forbids observables not composed from the `repeatWhen` or `retryWhen` notifier. | TBD |
72
+
|[`no-ignored-observable`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-ignored-observable.md)| Forbids the ignoring of observables returned by functions. | TBD |
73
+
|[`no-ignored-replay-buffer`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-ignored-replay-buffer.md)| Forbids using `ReplaySubject`, `publishReplay` or `shareReplay` without specifying the buffer size. | TBD |
74
+
|[`no-ignored-subscribe`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-ignored-subscribe.md)| Forbids the calling of `subscribe` without specifying arguments. | TBD |
75
+
|[`no-ignored-subscription`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-ignored-subscription.md)| Forbids ignoring the subscription returned by `subscribe`. | TBD |
76
+
|[`no-ignored-takewhile-value`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-ignored-takewhile-value.md)| Forbids ignoring the value within `takeWhile`. | TBD |
77
+
|[`no-implicit-any-catch`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-implicit-any-catch.md)| Like the [`no-implicit-any-catch` rule](https://github.com/typescript-eslint/typescript-eslint/pull/2202) in `@typescript-eslint/eslint-plugin`, but for the `catchError` operator instead of `catch` clauses. | TBD |
78
+
|[`no-index`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-index.md)| Forbids the importation from index modules - for the reason, see [this issue](https://github.com/ReactiveX/rxjs/issues/4230). | TBD |
79
+
|[`no-internal`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-internal.md)| Forbids the importation of internals. | TBD |
80
+
|[`no-nested-subscribe`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-nested-subscribe.md)| Forbids the calling of `subscribe` within a `subscribe` callback. | TBD |
81
+
|[`no-redundant-notify`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-redundant-notify.md)| Disallows redundant notifications from completed or errored observables. | TBD |
82
+
|[`no-sharereplay`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-sharereplay.md)| Forbids using the `shareReplay` operator. | TBD |
|[`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. | TBD |
85
+
|[`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. | TBD |
86
+
|[`no-tap`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-tap.md)| Forbids the use of the `tap` operator. | TBD |
87
+
|[`no-topromise`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-topromise.md)| Forbids the use of the `toPromise` method. | TBD |
88
+
|[`no-unbound-methods`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-unbound-methods.md)| Forbids the passing of unbound methods. | TBD |
89
+
|[`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. | TBD |
90
+
|[`no-unsafe-first`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-unsafe-first.md)| Forbids unsafe `first`/`take` usage in effects and epics. | TBD |
|[`no-unsafe-switchmap`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-unsafe-switchmap.md)| Forbids unsafe `switchMap` usage in effects and epics. | TBD |
93
+
|[`no-unsafe-takeuntil`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/no-unsafe-takeuntil.md)| Forbids the application of operators after `takeUntil`. | TBD |
94
+
|[`prefer-observer`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/prefer-observer.md)| Forbids the passing separate callbacks to `subscribe` and `tap`. | TBD |
95
+
|[`suffix-subjects`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/suffix-subjects.md)| Enforces the use of a suffix in subject identifiers. | TBD |
96
+
|[`throw-error`](https://github.com/cartant/eslint-plugin-rxjs/blob/main/docs/rules/throw-error.md)| Enforces the passing of `Error` values to error notifications. | TBD |
This rule can be configured so that developers can ban any observable creators they want to avoid in their project.
4
+
5
+
## Options
6
+
7
+
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.
8
+
9
+
The following configuration bans `partition` and `onErrorResumeNext`:
10
+
11
+
```json
12
+
{
13
+
"rxjs/ban-observables": [
14
+
"error",
15
+
{
16
+
"partition": true,
17
+
"of": false,
18
+
"onErrorResumeNext": "What is this? Visual Basic?"
This rule can be configured so that developers can ban any operators they want to avoid in their project.
4
+
5
+
## Options
6
+
7
+
This rule accepts a single option which is an object the keys of which are the names of operators and the values are either booleans or strings containing the explanation for the ban.
8
+
9
+
The following configuration bans `ajax` and `onErrorResumeNext`:
10
+
11
+
```json
12
+
{
13
+
"rxjs/ban-operators": [
14
+
"error",
15
+
{
16
+
"partition": true,
17
+
"map": false,
18
+
"onErrorResumeNext": "What is this? Visual Basic?"
This rule enforces the use of Finnish notation - i.e. the `$` suffix.
4
+
5
+
## Rule details
6
+
7
+
Examples of **incorrect** code for this rule:
8
+
9
+
```ts
10
+
const answers =of(42, 54);
11
+
```
12
+
13
+
Examples of **correct** code for this rule:
14
+
15
+
```ts
16
+
const answer$ =of(42, 54);
17
+
```
18
+
19
+
## Options
20
+
21
+
This rule accepts a single option which is an object with properties that determine whether Finnish notation is enforced for `functions`, `methods`, `parameters`, `properties` and `variables`. It also contains `names` and `types` properties that determine whether of not Finnish notation is to be enforced for specific names or types.
22
+
23
+
The default (Angular-friendly) configuration looks like this:
This rule enforces the use of `just` instead of `of`. Some other languages with Rx implementations use the former and this rule is for developers who have that preference.
4
+
5
+
## Options
6
+
7
+
This rule has no options.
8
+
9
+
## Further reading
10
+
11
+
-[Rename `of` to `just`](https://github.com/ReactiveX/rxjs/issues/3747)
0 commit comments