eslint-plugin-rxjs-x 0.4.1 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -17,6 +17,7 @@ There are some breaking changes:
17
17
  - If you need to continue using this old format, use the original `eslint-plugin-rxjs` or a different fork.
18
18
  - The plugin namespace specified in the `recommended` config was changed from `rxjs` to `rxjs-x`.
19
19
  - e.g. In your ESLint config, `rxjs/no-subject-value` should be renamed to `rxjs-x/no-subject-value`.
20
+ - The rule `rxjs/no-ignored-observable` is renamed to `rxjs-x/no-floating-observables`.
20
21
 
21
22
  A complete description of all changes are documented in the [CHANGELOG](CHANGELOG.md) file.
22
23
 
@@ -88,10 +89,10 @@ The package includes the following rules.
88
89
  | [no-explicit-generics](docs/rules/no-explicit-generics.md) | Disallow unnecessary explicit generic type arguments. | 🔒 | | | | |
89
90
  | [no-exposed-subjects](docs/rules/no-exposed-subjects.md) | Disallow public and protected subjects. | 🔒 | | | 💭 | |
90
91
  | [no-finnish](docs/rules/no-finnish.md) | Disallow Finnish notation. | | | | 💭 | |
92
+ | [no-floating-observables](docs/rules/no-floating-observables.md) | Require Observables to be handled appropriately. | 🔒 | | | 💭 | |
91
93
  | [no-ignored-default-value](docs/rules/no-ignored-default-value.md) | Disallow using `firstValueFrom`, `lastValueFrom`, `first`, and `last` without specifying a default value. | 🔒 | | | 💭 | |
92
94
  | [no-ignored-error](docs/rules/no-ignored-error.md) | Disallow calling `subscribe` without specifying an error handler. | 🔒 | | | 💭 | |
93
95
  | [no-ignored-notifier](docs/rules/no-ignored-notifier.md) | Disallow observables not composed from the `repeatWhen` or `retryWhen` notifier. | ✅ 🔒 | | | 💭 | |
94
- | [no-ignored-observable](docs/rules/no-ignored-observable.md) | Disallow ignoring observables returned by functions. | 🔒 | | | 💭 | |
95
96
  | [no-ignored-replay-buffer](docs/rules/no-ignored-replay-buffer.md) | Disallow using `ReplaySubject`, `publishReplay` or `shareReplay` without specifying the buffer size. | ✅ 🔒 | | | | |
96
97
  | [no-ignored-subscribe](docs/rules/no-ignored-subscribe.md) | Disallow calling `subscribe` without specifying arguments. | | | | 💭 | |
97
98
  | [no-ignored-subscription](docs/rules/no-ignored-subscription.md) | Disallow ignoring the subscription returned by `subscribe`. | | | | 💭 | |
@@ -99,6 +100,7 @@ The package includes the following rules.
99
100
  | [no-implicit-any-catch](docs/rules/no-implicit-any-catch.md) | Disallow implicit `any` error parameters in `catchError` operators. | ✅ 🔒 | 🔧 | 💡 | 💭 | |
100
101
  | [no-index](docs/rules/no-index.md) | Disallow importing index modules. | ✅ 🔒 | | | | |
101
102
  | [no-internal](docs/rules/no-internal.md) | Disallow importing internal modules. | ✅ 🔒 | 🔧 | 💡 | | |
103
+ | [no-misused-observables](docs/rules/no-misused-observables.md) | Disallow Observables in places not designed to handle them. | 🔒 | | | 💭 | |
102
104
  | [no-nested-subscribe](docs/rules/no-nested-subscribe.md) | Disallow calling `subscribe` within a `subscribe` callback. | ✅ 🔒 | | | 💭 | |
103
105
  | [no-redundant-notify](docs/rules/no-redundant-notify.md) | Disallow sending redundant notifications from completed or errored observables. | ✅ 🔒 | | | 💭 | |
104
106
  | [no-sharereplay](docs/rules/no-sharereplay.md) | Disallow unsafe `shareReplay` usage. | ✅ 🔒 | | | | |
@@ -107,16 +109,16 @@ The package includes the following rules.
107
109
  | [no-subject-value](docs/rules/no-subject-value.md) | Disallow accessing the `value` property of a `BehaviorSubject` instance. | | | | 💭 | |
108
110
  | [no-subscribe-handlers](docs/rules/no-subscribe-handlers.md) | Disallow passing handlers to `subscribe`. | | | | 💭 | |
109
111
  | [no-tap](docs/rules/no-tap.md) | Disallow the `tap` operator. | | | | | ❌ |
110
- | [no-topromise](docs/rules/no-topromise.md) | Disallow use of the `toPromise` method. | 🔒 | | 💡 | 💭 | |
112
+ | [no-topromise](docs/rules/no-topromise.md) | Disallow use of the `toPromise` method. | 🔒 | | 💡 | 💭 | |
111
113
  | [no-unbound-methods](docs/rules/no-unbound-methods.md) | Disallow passing unbound methods. | ✅ 🔒 | | | 💭 | |
112
114
  | [no-unsafe-catch](docs/rules/no-unsafe-catch.md) | Disallow unsafe `catchError` usage in effects and epics. | | | | 💭 | |
113
115
  | [no-unsafe-first](docs/rules/no-unsafe-first.md) | Disallow unsafe `first`/`take` usage in effects and epics. | | | | 💭 | |
114
116
  | [no-unsafe-subject-next](docs/rules/no-unsafe-subject-next.md) | Disallow unsafe optional `next` calls. | ✅ 🔒 | | | 💭 | |
115
117
  | [no-unsafe-switchmap](docs/rules/no-unsafe-switchmap.md) | Disallow unsafe `switchMap` usage in effects and epics. | | | | 💭 | |
116
118
  | [no-unsafe-takeuntil](docs/rules/no-unsafe-takeuntil.md) | Disallow applying operators after `takeUntil`. | ✅ 🔒 | | | 💭 | |
117
- | [prefer-observer](docs/rules/prefer-observer.md) | Disallow passing separate handlers to `subscribe` and `tap`. | 🔒 | 🔧 | 💡 | 💭 | |
118
- | [prefer-root-operators](docs/rules/prefer-root-operators.md) | Disallow importing operators from `rxjs/operators`. | 🔒 | 🔧 | 💡 | | |
119
+ | [prefer-observer](docs/rules/prefer-observer.md) | Disallow passing separate handlers to `subscribe` and `tap`. | 🔒 | 🔧 | 💡 | 💭 | |
120
+ | [prefer-root-operators](docs/rules/prefer-root-operators.md) | Disallow importing operators from `rxjs/operators`. | 🔒 | 🔧 | 💡 | | |
119
121
  | [suffix-subjects](docs/rules/suffix-subjects.md) | Enforce the use of a suffix in subject identifiers. | | | | 💭 | |
120
- | [throw-error](docs/rules/throw-error.md) | Enforce passing only `Error` values to `throwError`. | 🔒 | | | 💭 | |
122
+ | [throw-error](docs/rules/throw-error.md) | Enforce passing only `Error` values to `throwError`. | 🔒 | | | 💭 | |
121
123
 
122
124
  <!-- end auto-generated rules list -->
package/dist/index.d.mts CHANGED
@@ -6,9 +6,19 @@ interface RxjsXRuleDocs {
6
6
  requiresTypeChecking?: boolean;
7
7
  }
8
8
 
9
+ interface ChecksVoidReturnOptions {
10
+ arguments?: boolean;
11
+ attributes?: boolean;
12
+ inheritedMethods?: boolean;
13
+ properties?: boolean;
14
+ returns?: boolean;
15
+ variables?: boolean;
16
+ }
17
+
9
18
  declare const rxjsX: {
10
19
  configs: {
11
20
  recommended: {
21
+ name: "rxjs-x/recommended";
12
22
  plugins: {
13
23
  'rxjs-x': TSESLint.FlatConfig.Plugin;
14
24
  };
@@ -25,12 +35,17 @@ declare const rxjsX: {
25
35
  'rxjs-x/no-redundant-notify': "error";
26
36
  'rxjs-x/no-sharereplay': "error";
27
37
  'rxjs-x/no-subject-unsubscribe': "error";
38
+ 'rxjs-x/no-topromise': "error";
28
39
  'rxjs-x/no-unbound-methods': "error";
29
40
  'rxjs-x/no-unsafe-subject-next': "error";
30
41
  'rxjs-x/no-unsafe-takeuntil': "error";
42
+ 'rxjs-x/prefer-observer': "error";
43
+ 'rxjs-x/prefer-root-operators': "error";
44
+ 'rxjs-x/throw-error': "error";
31
45
  };
32
46
  };
33
47
  strict: {
48
+ name: "rxjs-x/strict";
34
49
  plugins: {
35
50
  'rxjs-x': TSESLint.FlatConfig.Plugin;
36
51
  };
@@ -39,10 +54,10 @@ declare const rxjsX: {
39
54
  'rxjs-x/no-create': "error";
40
55
  'rxjs-x/no-explicit-generics': "error";
41
56
  'rxjs-x/no-exposed-subjects': "error";
57
+ 'rxjs-x/no-floating-observables': "error";
42
58
  'rxjs-x/no-ignored-default-value': "error";
43
59
  'rxjs-x/no-ignored-error': "error";
44
60
  'rxjs-x/no-ignored-notifier': "error";
45
- 'rxjs-x/no-ignored-observable': "error";
46
61
  'rxjs-x/no-ignored-replay-buffer': "error";
47
62
  'rxjs-x/no-ignored-takewhile-value': "error";
48
63
  'rxjs-x/no-implicit-any-catch': ["error", {
@@ -50,6 +65,7 @@ declare const rxjsX: {
50
65
  }];
51
66
  'rxjs-x/no-index': "error";
52
67
  'rxjs-x/no-internal': "error";
68
+ 'rxjs-x/no-misused-observables': "error";
53
69
  'rxjs-x/no-nested-subscribe': "error";
54
70
  'rxjs-x/no-redundant-notify': "error";
55
71
  'rxjs-x/no-sharereplay': "error";
@@ -99,10 +115,12 @@ declare const rxjsX: {
99
115
  allowProtected?: boolean;
100
116
  }[], RxjsXRuleDocs, TSESLint.RuleListener>;
101
117
  'no-finnish': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
118
+ 'no-floating-observables': TSESLint.RuleModule<"forbidden" | "forbiddenNoVoid", readonly {
119
+ ignoreVoid?: boolean;
120
+ }[], RxjsXRuleDocs, TSESLint.RuleListener>;
102
121
  'no-ignored-default-value': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
103
122
  'no-ignored-error': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
104
123
  'no-ignored-notifier': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
105
- 'no-ignored-observable': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
106
124
  'no-ignored-replay-buffer': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
107
125
  'no-ignored-subscribe': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
108
126
  'no-ignored-subscription': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
@@ -112,6 +130,10 @@ declare const rxjsX: {
112
130
  }[], RxjsXRuleDocs, TSESLint.RuleListener>;
113
131
  'no-index': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
114
132
  'no-internal': TSESLint.RuleModule<"forbidden" | "suggest", [], RxjsXRuleDocs, TSESLint.RuleListener>;
133
+ 'no-misused-observables': TSESLint.RuleModule<"forbiddenVoidReturnArgument" | "forbiddenVoidReturnAttribute" | "forbiddenVoidReturnInheritedMethod" | "forbiddenVoidReturnProperty" | "forbiddenVoidReturnReturnValue" | "forbiddenVoidReturnVariable" | "forbiddenSpread", readonly {
134
+ checksVoidReturn?: boolean | ChecksVoidReturnOptions;
135
+ checksSpreads?: boolean;
136
+ }[], RxjsXRuleDocs, TSESLint.RuleListener>;
115
137
  'no-nested-subscribe': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
116
138
  'no-redundant-notify': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
117
139
  'no-sharereplay': TSESLint.RuleModule<"forbidden" | "forbiddenWithoutConfig", readonly {
package/dist/index.d.ts CHANGED
@@ -6,9 +6,19 @@ interface RxjsXRuleDocs {
6
6
  requiresTypeChecking?: boolean;
7
7
  }
8
8
 
9
+ interface ChecksVoidReturnOptions {
10
+ arguments?: boolean;
11
+ attributes?: boolean;
12
+ inheritedMethods?: boolean;
13
+ properties?: boolean;
14
+ returns?: boolean;
15
+ variables?: boolean;
16
+ }
17
+
9
18
  declare const rxjsX: {
10
19
  configs: {
11
20
  recommended: {
21
+ name: "rxjs-x/recommended";
12
22
  plugins: {
13
23
  'rxjs-x': TSESLint.FlatConfig.Plugin;
14
24
  };
@@ -25,12 +35,17 @@ declare const rxjsX: {
25
35
  'rxjs-x/no-redundant-notify': "error";
26
36
  'rxjs-x/no-sharereplay': "error";
27
37
  'rxjs-x/no-subject-unsubscribe': "error";
38
+ 'rxjs-x/no-topromise': "error";
28
39
  'rxjs-x/no-unbound-methods': "error";
29
40
  'rxjs-x/no-unsafe-subject-next': "error";
30
41
  'rxjs-x/no-unsafe-takeuntil': "error";
42
+ 'rxjs-x/prefer-observer': "error";
43
+ 'rxjs-x/prefer-root-operators': "error";
44
+ 'rxjs-x/throw-error': "error";
31
45
  };
32
46
  };
33
47
  strict: {
48
+ name: "rxjs-x/strict";
34
49
  plugins: {
35
50
  'rxjs-x': TSESLint.FlatConfig.Plugin;
36
51
  };
@@ -39,10 +54,10 @@ declare const rxjsX: {
39
54
  'rxjs-x/no-create': "error";
40
55
  'rxjs-x/no-explicit-generics': "error";
41
56
  'rxjs-x/no-exposed-subjects': "error";
57
+ 'rxjs-x/no-floating-observables': "error";
42
58
  'rxjs-x/no-ignored-default-value': "error";
43
59
  'rxjs-x/no-ignored-error': "error";
44
60
  'rxjs-x/no-ignored-notifier': "error";
45
- 'rxjs-x/no-ignored-observable': "error";
46
61
  'rxjs-x/no-ignored-replay-buffer': "error";
47
62
  'rxjs-x/no-ignored-takewhile-value': "error";
48
63
  'rxjs-x/no-implicit-any-catch': ["error", {
@@ -50,6 +65,7 @@ declare const rxjsX: {
50
65
  }];
51
66
  'rxjs-x/no-index': "error";
52
67
  'rxjs-x/no-internal': "error";
68
+ 'rxjs-x/no-misused-observables': "error";
53
69
  'rxjs-x/no-nested-subscribe': "error";
54
70
  'rxjs-x/no-redundant-notify': "error";
55
71
  'rxjs-x/no-sharereplay': "error";
@@ -99,10 +115,12 @@ declare const rxjsX: {
99
115
  allowProtected?: boolean;
100
116
  }[], RxjsXRuleDocs, TSESLint.RuleListener>;
101
117
  'no-finnish': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
118
+ 'no-floating-observables': TSESLint.RuleModule<"forbidden" | "forbiddenNoVoid", readonly {
119
+ ignoreVoid?: boolean;
120
+ }[], RxjsXRuleDocs, TSESLint.RuleListener>;
102
121
  'no-ignored-default-value': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
103
122
  'no-ignored-error': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
104
123
  'no-ignored-notifier': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
105
- 'no-ignored-observable': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
106
124
  'no-ignored-replay-buffer': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
107
125
  'no-ignored-subscribe': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
108
126
  'no-ignored-subscription': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
@@ -112,6 +130,10 @@ declare const rxjsX: {
112
130
  }[], RxjsXRuleDocs, TSESLint.RuleListener>;
113
131
  'no-index': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
114
132
  'no-internal': TSESLint.RuleModule<"forbidden" | "suggest", [], RxjsXRuleDocs, TSESLint.RuleListener>;
133
+ 'no-misused-observables': TSESLint.RuleModule<"forbiddenVoidReturnArgument" | "forbiddenVoidReturnAttribute" | "forbiddenVoidReturnInheritedMethod" | "forbiddenVoidReturnProperty" | "forbiddenVoidReturnReturnValue" | "forbiddenVoidReturnVariable" | "forbiddenSpread", readonly {
134
+ checksVoidReturn?: boolean | ChecksVoidReturnOptions;
135
+ checksSpreads?: boolean;
136
+ }[], RxjsXRuleDocs, TSESLint.RuleListener>;
115
137
  'no-nested-subscribe': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
116
138
  'no-redundant-notify': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
117
139
  'no-sharereplay': TSESLint.RuleModule<"forbidden" | "forbiddenWithoutConfig", readonly {