eslint-plugin-rxjs-x 0.7.7 → 0.8.0
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 +51 -17
- package/dist/index.d.mts +261 -104
- package/dist/index.d.ts +261 -104
- package/dist/index.js +53 -48
- package/dist/index.mjs +53 -48
- package/package.json +15 -14
package/README.md
CHANGED
|
@@ -7,32 +7,70 @@ This ESLint plugin is intended to prevent issues with [RxJS](https://github.com/
|
|
|
7
7
|
|
|
8
8
|
Most of these rules require TypeScript typed linting and are indicated as such below.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Migration Guide from `eslint-plugin-rxjs`
|
|
11
11
|
|
|
12
|
-
This project
|
|
13
|
-
|
|
14
|
-
There are some breaking changes:
|
|
12
|
+
This project started as a fork of [`eslint-plugin-rxjs`](https://github.com/cartant/eslint-plugin-rxjs)
|
|
13
|
+
but has since introduced new features which involve breaking changes.
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
- The rule `rxjs/no-ignored-observable` is renamed to `rxjs-x/no-floating-observables`.
|
|
15
|
+
1. Migrate your config from the old `.eslintrc` format to `eslint.config.mjs` (or similar), and uninstall `eslint-plugin-rxjs`.
|
|
16
|
+
- See ESLint's guide here: [https://eslint.org/docs/latest/use/configure/migration-guide].
|
|
17
|
+
- If you need to continue using the deprecated format, use the original `eslint-plugin-rxjs` or a different fork.
|
|
18
|
+
2. Install `eslint-plugin-rxjs-x`, and import it into your config.
|
|
21
19
|
|
|
22
|
-
|
|
20
|
+
```diff
|
|
21
|
+
+ import rxjsX from 'eslint-plugin-rxjs-x';
|
|
22
|
+
```
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
3. If you previously used the `plugin:rxjs/recommended` shared config, add `rxjsX.configs.recommended` to your `configs` block:
|
|
25
|
+
|
|
26
|
+
```diff
|
|
27
|
+
configs: {
|
|
28
|
+
+ rxjsX.configs.recommended,
|
|
29
|
+
},
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
- Note: `eslint-plugin-rxjs-x` provides a `strict` shared config, so consider using `rxjsX.configs.strict` instead.
|
|
33
|
+
4. If you previously did _not_ use a shared config, add the plugin to your `plugins` block with the new namespace:
|
|
34
|
+
|
|
35
|
+
```diff
|
|
36
|
+
plugins: {
|
|
37
|
+
+ 'rxjs-x': rxjsX,
|
|
38
|
+
},
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
- Note: this is unnecessary if you are using a shared config.
|
|
42
|
+
5. In your `rules` block, replace the namespace `rxjs` with `rxjs-x`:
|
|
43
|
+
|
|
44
|
+
```diff
|
|
45
|
+
- 'rxjs/no-subject-value': 'error',
|
|
46
|
+
+ 'rxjs-x/no-subject-value': 'error',
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
6. If you previously used `rxjs/no-ignored-observable`, replace it with `rxjs-x/no-floating-observables`.
|
|
50
|
+
|
|
51
|
+
```diff
|
|
52
|
+
- 'rxjs/no-ignored-observable': 'error',
|
|
53
|
+
+ 'rxjs-x/no-floating-observables': 'error',
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
> [!TIP]
|
|
57
|
+
> A complete description of all changes are documented in the [CHANGELOG](CHANGELOG.md) file.
|
|
58
|
+
|
|
59
|
+
## Installation Guide
|
|
25
60
|
|
|
26
61
|
See [typescript-eslint's Getting Started](https://typescript-eslint.io/getting-started) for a full ESLint setup guide.
|
|
27
62
|
|
|
28
|
-
|
|
63
|
+
1. Enable typed linting.
|
|
64
|
+
- See [Linting with Type Information](https://typescript-eslint.io/getting-started/typed-linting/) for more information.
|
|
65
|
+
2. Start with the `recommended` shared config in your `eslint.config.mjs`.
|
|
29
66
|
|
|
30
67
|
```js
|
|
31
68
|
// @ts-check
|
|
69
|
+
import { defineConfig } from 'eslint/config';
|
|
32
70
|
import tseslint from 'typescript-eslint';
|
|
33
71
|
import rxjsX from 'eslint-plugin-rxjs-x';
|
|
34
72
|
|
|
35
|
-
export default
|
|
73
|
+
export default defineConfig({
|
|
36
74
|
extends: [
|
|
37
75
|
...tseslint.configs.recommended,
|
|
38
76
|
rxjsX.configs.recommended,
|
|
@@ -45,10 +83,6 @@ export default tseslint.config({
|
|
|
45
83
|
});
|
|
46
84
|
```
|
|
47
85
|
|
|
48
|
-
The above example uses `typescript-eslint`'s built-in config to set up the TypeScript parser for us.
|
|
49
|
-
Enabling `projectService` then turns on typed linting.
|
|
50
|
-
See [Linting with Type Information](https://typescript-eslint.io/getting-started/typed-linting/) for details.
|
|
51
|
-
|
|
52
86
|
## Configs
|
|
53
87
|
|
|
54
88
|
<!-- begin auto-generated configs list -->
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
-
|
|
3
|
-
interface RxjsXRuleDocs {
|
|
4
|
-
description: string;
|
|
5
|
-
recommended?: TSESLint.RuleRecommendation | TSESLint.RuleRecommendationAcrossConfigs<unknown[]>;
|
|
6
|
-
requiresTypeChecking?: boolean;
|
|
7
|
-
}
|
|
2
|
+
import { ESLint, Rule } from 'eslint';
|
|
8
3
|
|
|
9
4
|
interface ChecksVoidReturnOptions {
|
|
10
5
|
arguments?: boolean;
|
|
@@ -15,12 +10,268 @@ interface ChecksVoidReturnOptions {
|
|
|
15
10
|
variables?: boolean;
|
|
16
11
|
}
|
|
17
12
|
|
|
13
|
+
declare const allRules: {
|
|
14
|
+
'ban-observables': TSESLint.RuleModule<"forbidden", readonly Record<string, string | boolean>[], {
|
|
15
|
+
description: "Disallow banned observable creators.";
|
|
16
|
+
}, TSESLint.RuleListener>;
|
|
17
|
+
'ban-operators': TSESLint.RuleModule<"forbidden", readonly Record<string, string | boolean>[], {
|
|
18
|
+
description: "Disallow banned operators.";
|
|
19
|
+
requiresTypeChecking: true;
|
|
20
|
+
}, TSESLint.RuleListener>;
|
|
21
|
+
finnish: TSESLint.RuleModule<"shouldBeFinnish" | "shouldNotBeFinnish", readonly {
|
|
22
|
+
functions?: boolean;
|
|
23
|
+
methods?: boolean;
|
|
24
|
+
names?: Record<string, boolean>;
|
|
25
|
+
parameters?: boolean;
|
|
26
|
+
properties?: boolean;
|
|
27
|
+
strict?: boolean;
|
|
28
|
+
types?: Record<string, boolean>;
|
|
29
|
+
variables?: boolean;
|
|
30
|
+
}[], {
|
|
31
|
+
description: "Enforce Finnish notation.";
|
|
32
|
+
requiresTypeChecking: true;
|
|
33
|
+
}, TSESLint.RuleListener>;
|
|
34
|
+
just: TSESLint.RuleModule<"forbidden", [], {
|
|
35
|
+
description: "Require the use of `just` instead of `of`.";
|
|
36
|
+
}, TSESLint.RuleListener>;
|
|
37
|
+
macro: TSESLint.RuleModule<"macro", [], {
|
|
38
|
+
description: "Require the use of the RxJS Tools Babel macro.";
|
|
39
|
+
}, TSESLint.RuleListener>;
|
|
40
|
+
'no-async-subscribe': TSESLint.RuleModule<"forbidden", [], {
|
|
41
|
+
description: "Disallow passing `async` functions to `subscribe`.";
|
|
42
|
+
recommended: "recommended";
|
|
43
|
+
requiresTypeChecking: true;
|
|
44
|
+
}, TSESLint.RuleListener>;
|
|
45
|
+
'no-compat': TSESLint.RuleModule<"forbidden", [], {
|
|
46
|
+
description: "Disallow the `rxjs-compat` package.";
|
|
47
|
+
}, TSESLint.RuleListener>;
|
|
48
|
+
'no-connectable': TSESLint.RuleModule<"forbidden", [], {
|
|
49
|
+
description: "Disallow operators that return connectable observables.";
|
|
50
|
+
requiresTypeChecking: true;
|
|
51
|
+
}, TSESLint.RuleListener>;
|
|
52
|
+
'no-create': TSESLint.RuleModule<"forbidden", [], {
|
|
53
|
+
description: "Disallow the static `Observable.create` function.";
|
|
54
|
+
recommended: "recommended";
|
|
55
|
+
requiresTypeChecking: true;
|
|
56
|
+
}, TSESLint.RuleListener>;
|
|
57
|
+
'no-cyclic-action': TSESLint.RuleModule<"forbidden", readonly {
|
|
58
|
+
observable?: string;
|
|
59
|
+
}[], {
|
|
60
|
+
description: "Disallow cyclic actions in effects and epics.";
|
|
61
|
+
requiresTypeChecking: true;
|
|
62
|
+
}, TSESLint.RuleListener>;
|
|
63
|
+
'no-explicit-generics': TSESLint.RuleModule<"forbidden", [], {
|
|
64
|
+
description: "Disallow unnecessary explicit generic type arguments.";
|
|
65
|
+
}, TSESLint.RuleListener>;
|
|
66
|
+
'no-exposed-subjects': TSESLint.RuleModule<"forbidden" | "forbiddenAllowProtected", readonly {
|
|
67
|
+
allowProtected?: boolean;
|
|
68
|
+
}[], {
|
|
69
|
+
description: "Disallow public and protected subjects.";
|
|
70
|
+
recommended: "strict";
|
|
71
|
+
requiresTypeChecking: true;
|
|
72
|
+
}, TSESLint.RuleListener>;
|
|
73
|
+
'no-finnish': TSESLint.RuleModule<"forbidden", [], {
|
|
74
|
+
description: "Disallow Finnish notation.";
|
|
75
|
+
requiresTypeChecking: true;
|
|
76
|
+
}, TSESLint.RuleListener>;
|
|
77
|
+
'no-floating-observables': TSESLint.RuleModule<"forbidden" | "forbiddenNoVoid", readonly {
|
|
78
|
+
ignoreVoid?: boolean;
|
|
79
|
+
}[], {
|
|
80
|
+
description: "Require Observables to be handled appropriately.";
|
|
81
|
+
recommended: "strict";
|
|
82
|
+
requiresTypeChecking: true;
|
|
83
|
+
}, TSESLint.RuleListener>;
|
|
84
|
+
'no-ignored-default-value': TSESLint.RuleModule<"forbidden", [], {
|
|
85
|
+
description: "Disallow using `firstValueFrom`, `lastValueFrom`, `first`, and `last` without specifying a default value.";
|
|
86
|
+
recommended: "strict";
|
|
87
|
+
requiresTypeChecking: true;
|
|
88
|
+
}, TSESLint.RuleListener>;
|
|
89
|
+
'no-ignored-error': TSESLint.RuleModule<"forbidden", [], {
|
|
90
|
+
description: "Disallow calling `subscribe` without specifying an error handler.";
|
|
91
|
+
recommended: "strict";
|
|
92
|
+
requiresTypeChecking: true;
|
|
93
|
+
}, TSESLint.RuleListener>;
|
|
94
|
+
'no-ignored-notifier': TSESLint.RuleModule<"forbidden", [], {
|
|
95
|
+
description: "Disallow observables not composed from the `repeatWhen` or `retryWhen` notifier.";
|
|
96
|
+
recommended: "recommended";
|
|
97
|
+
requiresTypeChecking: true;
|
|
98
|
+
}, TSESLint.RuleListener>;
|
|
99
|
+
'no-ignored-replay-buffer': TSESLint.RuleModule<"forbidden", [], {
|
|
100
|
+
description: "Disallow using `ReplaySubject`, `publishReplay` or `shareReplay` without specifying the buffer size.";
|
|
101
|
+
recommended: "recommended";
|
|
102
|
+
}, TSESLint.RuleListener>;
|
|
103
|
+
'no-ignored-subscribe': TSESLint.RuleModule<"forbidden", [], {
|
|
104
|
+
description: "Disallow calling `subscribe` without specifying arguments.";
|
|
105
|
+
requiresTypeChecking: true;
|
|
106
|
+
}, TSESLint.RuleListener>;
|
|
107
|
+
'no-ignored-subscription': TSESLint.RuleModule<"forbidden", readonly {
|
|
108
|
+
completers?: string[];
|
|
109
|
+
postCompleters?: string[];
|
|
110
|
+
}[], {
|
|
111
|
+
description: "Disallow ignoring the subscription returned by `subscribe`.";
|
|
112
|
+
requiresTypeChecking: true;
|
|
113
|
+
}, TSESLint.RuleListener>;
|
|
114
|
+
'no-ignored-takewhile-value': TSESLint.RuleModule<"forbidden", [], {
|
|
115
|
+
description: "Disallow ignoring the value within `takeWhile`.";
|
|
116
|
+
recommended: "recommended";
|
|
117
|
+
}, TSESLint.RuleListener>;
|
|
118
|
+
'no-implicit-any-catch': TSESLint.RuleModule<"explicitAny" | "implicitAny" | "narrowed" | "suggestExplicitUnknown", readonly {
|
|
119
|
+
allowExplicitAny?: boolean;
|
|
120
|
+
}[], {
|
|
121
|
+
description: "Disallow implicit `any` error parameters in `catchError` operators.";
|
|
122
|
+
recommended: {
|
|
123
|
+
recommended: true;
|
|
124
|
+
strict: [{
|
|
125
|
+
allowExplicitAny: boolean;
|
|
126
|
+
}];
|
|
127
|
+
};
|
|
128
|
+
requiresTypeChecking: true;
|
|
129
|
+
}, TSESLint.RuleListener>;
|
|
130
|
+
'no-index': TSESLint.RuleModule<"forbidden", [], {
|
|
131
|
+
description: "Disallow importing index modules.";
|
|
132
|
+
recommended: "recommended";
|
|
133
|
+
}, TSESLint.RuleListener>;
|
|
134
|
+
'no-internal': TSESLint.RuleModule<"forbidden" | "suggest", [], {
|
|
135
|
+
description: "Disallow importing internal modules.";
|
|
136
|
+
recommended: "recommended";
|
|
137
|
+
}, TSESLint.RuleListener>;
|
|
138
|
+
'no-misused-observables': TSESLint.RuleModule<"forbiddenVoidReturnArgument" | "forbiddenVoidReturnAttribute" | "forbiddenVoidReturnInheritedMethod" | "forbiddenVoidReturnProperty" | "forbiddenVoidReturnReturnValue" | "forbiddenVoidReturnVariable" | "forbiddenSpread", readonly {
|
|
139
|
+
checksVoidReturn?: boolean | ChecksVoidReturnOptions;
|
|
140
|
+
checksSpreads?: boolean;
|
|
141
|
+
}[], {
|
|
142
|
+
description: "Disallow Observables in places not designed to handle them.";
|
|
143
|
+
recommended: "strict";
|
|
144
|
+
requiresTypeChecking: true;
|
|
145
|
+
}, TSESLint.RuleListener>;
|
|
146
|
+
'no-nested-subscribe': TSESLint.RuleModule<"forbidden", [], {
|
|
147
|
+
description: "Disallow calling `subscribe` within a `subscribe` callback.";
|
|
148
|
+
recommended: "recommended";
|
|
149
|
+
requiresTypeChecking: true;
|
|
150
|
+
}, TSESLint.RuleListener>;
|
|
151
|
+
'no-redundant-notify': TSESLint.RuleModule<"forbidden", [], {
|
|
152
|
+
description: "Disallow sending redundant notifications from completed or errored observables.";
|
|
153
|
+
recommended: "recommended";
|
|
154
|
+
requiresTypeChecking: true;
|
|
155
|
+
}, TSESLint.RuleListener>;
|
|
156
|
+
'no-sharereplay': TSESLint.RuleModule<"forbidden" | "forbiddenWithoutConfig", readonly {
|
|
157
|
+
allowConfig?: boolean;
|
|
158
|
+
}[], {
|
|
159
|
+
description: "Disallow unsafe `shareReplay` usage.";
|
|
160
|
+
recommended: "recommended";
|
|
161
|
+
}, TSESLint.RuleListener>;
|
|
162
|
+
'no-subclass': TSESLint.RuleModule<"forbidden", [], {
|
|
163
|
+
description: "Disallow subclassing RxJS classes.";
|
|
164
|
+
recommended: "strict";
|
|
165
|
+
requiresTypeChecking: true;
|
|
166
|
+
}, TSESLint.RuleListener>;
|
|
167
|
+
'no-subject-unsubscribe': TSESLint.RuleModule<"forbidden", [], {
|
|
168
|
+
description: "Disallow calling the `unsubscribe` method of subjects.";
|
|
169
|
+
recommended: "recommended";
|
|
170
|
+
requiresTypeChecking: true;
|
|
171
|
+
}, TSESLint.RuleListener>;
|
|
172
|
+
'no-subject-value': TSESLint.RuleModule<"forbidden", [], {
|
|
173
|
+
description: "Disallow accessing the `value` property of a `BehaviorSubject` instance.";
|
|
174
|
+
requiresTypeChecking: true;
|
|
175
|
+
}, TSESLint.RuleListener>;
|
|
176
|
+
'no-subscribe-handlers': TSESLint.RuleModule<"forbidden", [], {
|
|
177
|
+
description: "Disallow passing handlers to `subscribe`.";
|
|
178
|
+
requiresTypeChecking: true;
|
|
179
|
+
}, TSESLint.RuleListener>;
|
|
180
|
+
'no-subscribe-in-pipe': TSESLint.RuleModule<"forbidden", [], {
|
|
181
|
+
description: "Disallow calling of `subscribe` within any RxJS operator inside a `pipe`.";
|
|
182
|
+
recommended: "recommended";
|
|
183
|
+
requiresTypeChecking: true;
|
|
184
|
+
}, TSESLint.RuleListener>;
|
|
185
|
+
'no-tap': TSESLint.RuleModule<"forbidden", [], {
|
|
186
|
+
description: "Disallow the `tap` operator.";
|
|
187
|
+
}, TSESLint.RuleListener>;
|
|
188
|
+
'no-topromise': TSESLint.RuleModule<"forbidden" | "suggestLastValueFromWithDefault" | "suggestLastValueFrom" | "suggestFirstValueFrom", [], {
|
|
189
|
+
description: "Disallow use of the `toPromise` method.";
|
|
190
|
+
recommended: "recommended";
|
|
191
|
+
requiresTypeChecking: true;
|
|
192
|
+
}, TSESLint.RuleListener>;
|
|
193
|
+
'no-unbound-methods': TSESLint.RuleModule<"forbidden", readonly {
|
|
194
|
+
allowTypes?: string[];
|
|
195
|
+
}[], {
|
|
196
|
+
description: "Disallow passing unbound methods.";
|
|
197
|
+
recommended: "recommended";
|
|
198
|
+
requiresTypeChecking: true;
|
|
199
|
+
}, TSESLint.RuleListener>;
|
|
200
|
+
'no-unsafe-catch': TSESLint.RuleModule<"forbidden", readonly {
|
|
201
|
+
observable?: string;
|
|
202
|
+
}[], {
|
|
203
|
+
description: "Disallow unsafe `catchError` usage in effects and epics.";
|
|
204
|
+
requiresTypeChecking: true;
|
|
205
|
+
}, TSESLint.RuleListener>;
|
|
206
|
+
'no-unsafe-first': TSESLint.RuleModule<"forbidden", readonly {
|
|
207
|
+
observable?: string;
|
|
208
|
+
}[], {
|
|
209
|
+
description: "Disallow unsafe `first`/`take` usage in effects and epics.";
|
|
210
|
+
requiresTypeChecking: true;
|
|
211
|
+
}, TSESLint.RuleListener>;
|
|
212
|
+
'no-unsafe-subject-next': TSESLint.RuleModule<"forbidden", [], {
|
|
213
|
+
description: "Disallow unsafe optional `next` calls.";
|
|
214
|
+
recommended: "recommended";
|
|
215
|
+
requiresTypeChecking: true;
|
|
216
|
+
}, TSESLint.RuleListener>;
|
|
217
|
+
'no-unsafe-switchmap': TSESLint.RuleModule<"forbidden", readonly {
|
|
218
|
+
allow?: string | string[];
|
|
219
|
+
disallow?: string | string[];
|
|
220
|
+
observable?: string;
|
|
221
|
+
}[], {
|
|
222
|
+
description: "Disallow unsafe `switchMap` usage in effects and epics.";
|
|
223
|
+
requiresTypeChecking: true;
|
|
224
|
+
}, TSESLint.RuleListener>;
|
|
225
|
+
'no-unsafe-takeuntil': TSESLint.RuleModule<"forbidden", readonly {
|
|
226
|
+
alias?: string[];
|
|
227
|
+
allow?: string[];
|
|
228
|
+
}[], {
|
|
229
|
+
description: "Disallow applying operators after `takeUntil`.";
|
|
230
|
+
recommended: "recommended";
|
|
231
|
+
requiresTypeChecking: true;
|
|
232
|
+
}, TSESLint.RuleListener>;
|
|
233
|
+
'prefer-observer': TSESLint.RuleModule<"forbidden", readonly {
|
|
234
|
+
allowNext?: boolean;
|
|
235
|
+
}[], {
|
|
236
|
+
description: "Disallow passing separate handlers to `subscribe` and `tap`.";
|
|
237
|
+
recommended: "recommended";
|
|
238
|
+
requiresTypeChecking: true;
|
|
239
|
+
}, TSESLint.RuleListener>;
|
|
240
|
+
'prefer-root-operators': TSESLint.RuleModule<"forbidden" | "suggest" | "forbiddenWithoutFix", [], {
|
|
241
|
+
description: "Disallow importing operators from `rxjs/operators`.";
|
|
242
|
+
recommended: "recommended";
|
|
243
|
+
}, TSESLint.RuleListener>;
|
|
244
|
+
'suffix-subjects': TSESLint.RuleModule<"forbidden", readonly {
|
|
245
|
+
parameters?: boolean;
|
|
246
|
+
properties?: boolean;
|
|
247
|
+
suffix?: string;
|
|
248
|
+
types?: Record<string, boolean>;
|
|
249
|
+
variables?: boolean;
|
|
250
|
+
}[], {
|
|
251
|
+
description: "Enforce the use of a suffix in subject identifiers.";
|
|
252
|
+
requiresTypeChecking: true;
|
|
253
|
+
}, TSESLint.RuleListener>;
|
|
254
|
+
'throw-error': TSESLint.RuleModule<"forbidden", readonly {
|
|
255
|
+
allowThrowingAny?: boolean;
|
|
256
|
+
allowThrowingUnknown?: boolean;
|
|
257
|
+
}[], {
|
|
258
|
+
description: "Enforce passing only `Error` values to `throwError` or `Subject.error`.";
|
|
259
|
+
recommended: {
|
|
260
|
+
recommended: true;
|
|
261
|
+
strict: [{
|
|
262
|
+
allowThrowingAny: boolean;
|
|
263
|
+
allowThrowingUnknown: boolean;
|
|
264
|
+
}];
|
|
265
|
+
};
|
|
266
|
+
requiresTypeChecking: true;
|
|
267
|
+
}, TSESLint.RuleListener>;
|
|
268
|
+
};
|
|
18
269
|
declare const rxjsX: {
|
|
19
270
|
configs: {
|
|
20
271
|
recommended: {
|
|
21
272
|
name: "rxjs-x/recommended";
|
|
22
273
|
plugins: {
|
|
23
|
-
'rxjs-x':
|
|
274
|
+
'rxjs-x': ESLint.Plugin;
|
|
24
275
|
};
|
|
25
276
|
rules: {
|
|
26
277
|
'rxjs-x/no-async-subscribe': "error";
|
|
@@ -48,7 +299,7 @@ declare const rxjsX: {
|
|
|
48
299
|
strict: {
|
|
49
300
|
name: "rxjs-x/strict";
|
|
50
301
|
plugins: {
|
|
51
|
-
'rxjs-x':
|
|
302
|
+
'rxjs-x': ESLint.Plugin;
|
|
52
303
|
};
|
|
53
304
|
rules: {
|
|
54
305
|
'rxjs-x/no-async-subscribe': "error";
|
|
@@ -89,102 +340,8 @@ declare const rxjsX: {
|
|
|
89
340
|
name: string;
|
|
90
341
|
version: string;
|
|
91
342
|
};
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
'ban-operators': TSESLint.RuleModule<"forbidden", readonly Record<string, string | boolean>[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
95
|
-
finnish: TSESLint.RuleModule<"shouldBeFinnish" | "shouldNotBeFinnish", readonly {
|
|
96
|
-
functions?: boolean;
|
|
97
|
-
methods?: boolean;
|
|
98
|
-
names?: Record<string, boolean>;
|
|
99
|
-
parameters?: boolean;
|
|
100
|
-
properties?: boolean;
|
|
101
|
-
strict?: boolean;
|
|
102
|
-
types?: Record<string, boolean>;
|
|
103
|
-
variables?: boolean;
|
|
104
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
105
|
-
just: TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
106
|
-
macro: TSESLint.RuleModule<"macro", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
107
|
-
'no-async-subscribe': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
108
|
-
'no-compat': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
109
|
-
'no-connectable': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
110
|
-
'no-create': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
111
|
-
'no-cyclic-action': TSESLint.RuleModule<"forbidden", readonly {
|
|
112
|
-
observable?: string;
|
|
113
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
114
|
-
'no-explicit-generics': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
115
|
-
'no-exposed-subjects': TSESLint.RuleModule<"forbidden" | "forbiddenAllowProtected", readonly {
|
|
116
|
-
allowProtected?: boolean;
|
|
117
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
118
|
-
'no-finnish': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
119
|
-
'no-floating-observables': TSESLint.RuleModule<"forbidden" | "forbiddenNoVoid", readonly {
|
|
120
|
-
ignoreVoid?: boolean;
|
|
121
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
122
|
-
'no-ignored-default-value': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
123
|
-
'no-ignored-error': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
124
|
-
'no-ignored-notifier': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
125
|
-
'no-ignored-replay-buffer': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
126
|
-
'no-ignored-subscribe': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
127
|
-
'no-ignored-subscription': TSESLint.RuleModule<"forbidden", readonly {
|
|
128
|
-
completers?: string[];
|
|
129
|
-
postCompleters?: string[];
|
|
130
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
131
|
-
'no-ignored-takewhile-value': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
132
|
-
'no-implicit-any-catch': TSESLint.RuleModule<"explicitAny" | "implicitAny" | "narrowed" | "suggestExplicitUnknown", readonly {
|
|
133
|
-
allowExplicitAny?: boolean;
|
|
134
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
135
|
-
'no-index': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
136
|
-
'no-internal': TSESLint.RuleModule<"forbidden" | "suggest", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
137
|
-
'no-misused-observables': TSESLint.RuleModule<"forbiddenVoidReturnArgument" | "forbiddenVoidReturnAttribute" | "forbiddenVoidReturnInheritedMethod" | "forbiddenVoidReturnProperty" | "forbiddenVoidReturnReturnValue" | "forbiddenVoidReturnVariable" | "forbiddenSpread", readonly {
|
|
138
|
-
checksVoidReturn?: boolean | ChecksVoidReturnOptions;
|
|
139
|
-
checksSpreads?: boolean;
|
|
140
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
141
|
-
'no-nested-subscribe': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
142
|
-
'no-redundant-notify': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
143
|
-
'no-sharereplay': TSESLint.RuleModule<"forbidden" | "forbiddenWithoutConfig", readonly {
|
|
144
|
-
allowConfig?: boolean;
|
|
145
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
146
|
-
'no-subclass': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
147
|
-
'no-subject-unsubscribe': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
148
|
-
'no-subject-value': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
149
|
-
'no-subscribe-handlers': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
150
|
-
'no-subscribe-in-pipe': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
151
|
-
'no-tap': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
152
|
-
'no-topromise': TSESLint.RuleModule<"forbidden" | "suggestLastValueFromWithDefault" | "suggestLastValueFrom" | "suggestFirstValueFrom", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
153
|
-
'no-unbound-methods': TSESLint.RuleModule<"forbidden", readonly {
|
|
154
|
-
allowTypes?: string[];
|
|
155
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
156
|
-
'no-unsafe-catch': TSESLint.RuleModule<"forbidden", readonly {
|
|
157
|
-
observable?: string;
|
|
158
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
159
|
-
'no-unsafe-first': TSESLint.RuleModule<"forbidden", readonly {
|
|
160
|
-
observable?: string;
|
|
161
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
162
|
-
'no-unsafe-subject-next': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
163
|
-
'no-unsafe-switchmap': TSESLint.RuleModule<"forbidden", readonly {
|
|
164
|
-
allow?: string | string[];
|
|
165
|
-
disallow?: string | string[];
|
|
166
|
-
observable?: string;
|
|
167
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
168
|
-
'no-unsafe-takeuntil': TSESLint.RuleModule<"forbidden", readonly {
|
|
169
|
-
alias?: string[];
|
|
170
|
-
allow?: string[];
|
|
171
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
172
|
-
'prefer-observer': TSESLint.RuleModule<"forbidden", readonly {
|
|
173
|
-
allowNext?: boolean;
|
|
174
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
175
|
-
'prefer-root-operators': TSESLint.RuleModule<"forbidden" | "suggest" | "forbiddenWithoutFix", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
176
|
-
'suffix-subjects': TSESLint.RuleModule<"forbidden", readonly {
|
|
177
|
-
parameters?: boolean;
|
|
178
|
-
properties?: boolean;
|
|
179
|
-
suffix?: string;
|
|
180
|
-
types?: Record<string, boolean>;
|
|
181
|
-
variables?: boolean;
|
|
182
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
183
|
-
'throw-error': TSESLint.RuleModule<"forbidden", readonly {
|
|
184
|
-
allowThrowingAny?: boolean;
|
|
185
|
-
allowThrowingUnknown?: boolean;
|
|
186
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
187
|
-
};
|
|
343
|
+
/** Compatibility with `defineConfig` until https://github.com/typescript-eslint/typescript-eslint/issues/11543 is addressed. */
|
|
344
|
+
rules: { [K in keyof typeof allRules]: (typeof allRules)[K] & Rule.RuleModule; };
|
|
188
345
|
};
|
|
189
346
|
|
|
190
347
|
export { rxjsX as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
-
|
|
3
|
-
interface RxjsXRuleDocs {
|
|
4
|
-
description: string;
|
|
5
|
-
recommended?: TSESLint.RuleRecommendation | TSESLint.RuleRecommendationAcrossConfigs<unknown[]>;
|
|
6
|
-
requiresTypeChecking?: boolean;
|
|
7
|
-
}
|
|
2
|
+
import { ESLint, Rule } from 'eslint';
|
|
8
3
|
|
|
9
4
|
interface ChecksVoidReturnOptions {
|
|
10
5
|
arguments?: boolean;
|
|
@@ -15,12 +10,268 @@ interface ChecksVoidReturnOptions {
|
|
|
15
10
|
variables?: boolean;
|
|
16
11
|
}
|
|
17
12
|
|
|
13
|
+
declare const allRules: {
|
|
14
|
+
'ban-observables': TSESLint.RuleModule<"forbidden", readonly Record<string, string | boolean>[], {
|
|
15
|
+
description: "Disallow banned observable creators.";
|
|
16
|
+
}, TSESLint.RuleListener>;
|
|
17
|
+
'ban-operators': TSESLint.RuleModule<"forbidden", readonly Record<string, string | boolean>[], {
|
|
18
|
+
description: "Disallow banned operators.";
|
|
19
|
+
requiresTypeChecking: true;
|
|
20
|
+
}, TSESLint.RuleListener>;
|
|
21
|
+
finnish: TSESLint.RuleModule<"shouldBeFinnish" | "shouldNotBeFinnish", readonly {
|
|
22
|
+
functions?: boolean;
|
|
23
|
+
methods?: boolean;
|
|
24
|
+
names?: Record<string, boolean>;
|
|
25
|
+
parameters?: boolean;
|
|
26
|
+
properties?: boolean;
|
|
27
|
+
strict?: boolean;
|
|
28
|
+
types?: Record<string, boolean>;
|
|
29
|
+
variables?: boolean;
|
|
30
|
+
}[], {
|
|
31
|
+
description: "Enforce Finnish notation.";
|
|
32
|
+
requiresTypeChecking: true;
|
|
33
|
+
}, TSESLint.RuleListener>;
|
|
34
|
+
just: TSESLint.RuleModule<"forbidden", [], {
|
|
35
|
+
description: "Require the use of `just` instead of `of`.";
|
|
36
|
+
}, TSESLint.RuleListener>;
|
|
37
|
+
macro: TSESLint.RuleModule<"macro", [], {
|
|
38
|
+
description: "Require the use of the RxJS Tools Babel macro.";
|
|
39
|
+
}, TSESLint.RuleListener>;
|
|
40
|
+
'no-async-subscribe': TSESLint.RuleModule<"forbidden", [], {
|
|
41
|
+
description: "Disallow passing `async` functions to `subscribe`.";
|
|
42
|
+
recommended: "recommended";
|
|
43
|
+
requiresTypeChecking: true;
|
|
44
|
+
}, TSESLint.RuleListener>;
|
|
45
|
+
'no-compat': TSESLint.RuleModule<"forbidden", [], {
|
|
46
|
+
description: "Disallow the `rxjs-compat` package.";
|
|
47
|
+
}, TSESLint.RuleListener>;
|
|
48
|
+
'no-connectable': TSESLint.RuleModule<"forbidden", [], {
|
|
49
|
+
description: "Disallow operators that return connectable observables.";
|
|
50
|
+
requiresTypeChecking: true;
|
|
51
|
+
}, TSESLint.RuleListener>;
|
|
52
|
+
'no-create': TSESLint.RuleModule<"forbidden", [], {
|
|
53
|
+
description: "Disallow the static `Observable.create` function.";
|
|
54
|
+
recommended: "recommended";
|
|
55
|
+
requiresTypeChecking: true;
|
|
56
|
+
}, TSESLint.RuleListener>;
|
|
57
|
+
'no-cyclic-action': TSESLint.RuleModule<"forbidden", readonly {
|
|
58
|
+
observable?: string;
|
|
59
|
+
}[], {
|
|
60
|
+
description: "Disallow cyclic actions in effects and epics.";
|
|
61
|
+
requiresTypeChecking: true;
|
|
62
|
+
}, TSESLint.RuleListener>;
|
|
63
|
+
'no-explicit-generics': TSESLint.RuleModule<"forbidden", [], {
|
|
64
|
+
description: "Disallow unnecessary explicit generic type arguments.";
|
|
65
|
+
}, TSESLint.RuleListener>;
|
|
66
|
+
'no-exposed-subjects': TSESLint.RuleModule<"forbidden" | "forbiddenAllowProtected", readonly {
|
|
67
|
+
allowProtected?: boolean;
|
|
68
|
+
}[], {
|
|
69
|
+
description: "Disallow public and protected subjects.";
|
|
70
|
+
recommended: "strict";
|
|
71
|
+
requiresTypeChecking: true;
|
|
72
|
+
}, TSESLint.RuleListener>;
|
|
73
|
+
'no-finnish': TSESLint.RuleModule<"forbidden", [], {
|
|
74
|
+
description: "Disallow Finnish notation.";
|
|
75
|
+
requiresTypeChecking: true;
|
|
76
|
+
}, TSESLint.RuleListener>;
|
|
77
|
+
'no-floating-observables': TSESLint.RuleModule<"forbidden" | "forbiddenNoVoid", readonly {
|
|
78
|
+
ignoreVoid?: boolean;
|
|
79
|
+
}[], {
|
|
80
|
+
description: "Require Observables to be handled appropriately.";
|
|
81
|
+
recommended: "strict";
|
|
82
|
+
requiresTypeChecking: true;
|
|
83
|
+
}, TSESLint.RuleListener>;
|
|
84
|
+
'no-ignored-default-value': TSESLint.RuleModule<"forbidden", [], {
|
|
85
|
+
description: "Disallow using `firstValueFrom`, `lastValueFrom`, `first`, and `last` without specifying a default value.";
|
|
86
|
+
recommended: "strict";
|
|
87
|
+
requiresTypeChecking: true;
|
|
88
|
+
}, TSESLint.RuleListener>;
|
|
89
|
+
'no-ignored-error': TSESLint.RuleModule<"forbidden", [], {
|
|
90
|
+
description: "Disallow calling `subscribe` without specifying an error handler.";
|
|
91
|
+
recommended: "strict";
|
|
92
|
+
requiresTypeChecking: true;
|
|
93
|
+
}, TSESLint.RuleListener>;
|
|
94
|
+
'no-ignored-notifier': TSESLint.RuleModule<"forbidden", [], {
|
|
95
|
+
description: "Disallow observables not composed from the `repeatWhen` or `retryWhen` notifier.";
|
|
96
|
+
recommended: "recommended";
|
|
97
|
+
requiresTypeChecking: true;
|
|
98
|
+
}, TSESLint.RuleListener>;
|
|
99
|
+
'no-ignored-replay-buffer': TSESLint.RuleModule<"forbidden", [], {
|
|
100
|
+
description: "Disallow using `ReplaySubject`, `publishReplay` or `shareReplay` without specifying the buffer size.";
|
|
101
|
+
recommended: "recommended";
|
|
102
|
+
}, TSESLint.RuleListener>;
|
|
103
|
+
'no-ignored-subscribe': TSESLint.RuleModule<"forbidden", [], {
|
|
104
|
+
description: "Disallow calling `subscribe` without specifying arguments.";
|
|
105
|
+
requiresTypeChecking: true;
|
|
106
|
+
}, TSESLint.RuleListener>;
|
|
107
|
+
'no-ignored-subscription': TSESLint.RuleModule<"forbidden", readonly {
|
|
108
|
+
completers?: string[];
|
|
109
|
+
postCompleters?: string[];
|
|
110
|
+
}[], {
|
|
111
|
+
description: "Disallow ignoring the subscription returned by `subscribe`.";
|
|
112
|
+
requiresTypeChecking: true;
|
|
113
|
+
}, TSESLint.RuleListener>;
|
|
114
|
+
'no-ignored-takewhile-value': TSESLint.RuleModule<"forbidden", [], {
|
|
115
|
+
description: "Disallow ignoring the value within `takeWhile`.";
|
|
116
|
+
recommended: "recommended";
|
|
117
|
+
}, TSESLint.RuleListener>;
|
|
118
|
+
'no-implicit-any-catch': TSESLint.RuleModule<"explicitAny" | "implicitAny" | "narrowed" | "suggestExplicitUnknown", readonly {
|
|
119
|
+
allowExplicitAny?: boolean;
|
|
120
|
+
}[], {
|
|
121
|
+
description: "Disallow implicit `any` error parameters in `catchError` operators.";
|
|
122
|
+
recommended: {
|
|
123
|
+
recommended: true;
|
|
124
|
+
strict: [{
|
|
125
|
+
allowExplicitAny: boolean;
|
|
126
|
+
}];
|
|
127
|
+
};
|
|
128
|
+
requiresTypeChecking: true;
|
|
129
|
+
}, TSESLint.RuleListener>;
|
|
130
|
+
'no-index': TSESLint.RuleModule<"forbidden", [], {
|
|
131
|
+
description: "Disallow importing index modules.";
|
|
132
|
+
recommended: "recommended";
|
|
133
|
+
}, TSESLint.RuleListener>;
|
|
134
|
+
'no-internal': TSESLint.RuleModule<"forbidden" | "suggest", [], {
|
|
135
|
+
description: "Disallow importing internal modules.";
|
|
136
|
+
recommended: "recommended";
|
|
137
|
+
}, TSESLint.RuleListener>;
|
|
138
|
+
'no-misused-observables': TSESLint.RuleModule<"forbiddenVoidReturnArgument" | "forbiddenVoidReturnAttribute" | "forbiddenVoidReturnInheritedMethod" | "forbiddenVoidReturnProperty" | "forbiddenVoidReturnReturnValue" | "forbiddenVoidReturnVariable" | "forbiddenSpread", readonly {
|
|
139
|
+
checksVoidReturn?: boolean | ChecksVoidReturnOptions;
|
|
140
|
+
checksSpreads?: boolean;
|
|
141
|
+
}[], {
|
|
142
|
+
description: "Disallow Observables in places not designed to handle them.";
|
|
143
|
+
recommended: "strict";
|
|
144
|
+
requiresTypeChecking: true;
|
|
145
|
+
}, TSESLint.RuleListener>;
|
|
146
|
+
'no-nested-subscribe': TSESLint.RuleModule<"forbidden", [], {
|
|
147
|
+
description: "Disallow calling `subscribe` within a `subscribe` callback.";
|
|
148
|
+
recommended: "recommended";
|
|
149
|
+
requiresTypeChecking: true;
|
|
150
|
+
}, TSESLint.RuleListener>;
|
|
151
|
+
'no-redundant-notify': TSESLint.RuleModule<"forbidden", [], {
|
|
152
|
+
description: "Disallow sending redundant notifications from completed or errored observables.";
|
|
153
|
+
recommended: "recommended";
|
|
154
|
+
requiresTypeChecking: true;
|
|
155
|
+
}, TSESLint.RuleListener>;
|
|
156
|
+
'no-sharereplay': TSESLint.RuleModule<"forbidden" | "forbiddenWithoutConfig", readonly {
|
|
157
|
+
allowConfig?: boolean;
|
|
158
|
+
}[], {
|
|
159
|
+
description: "Disallow unsafe `shareReplay` usage.";
|
|
160
|
+
recommended: "recommended";
|
|
161
|
+
}, TSESLint.RuleListener>;
|
|
162
|
+
'no-subclass': TSESLint.RuleModule<"forbidden", [], {
|
|
163
|
+
description: "Disallow subclassing RxJS classes.";
|
|
164
|
+
recommended: "strict";
|
|
165
|
+
requiresTypeChecking: true;
|
|
166
|
+
}, TSESLint.RuleListener>;
|
|
167
|
+
'no-subject-unsubscribe': TSESLint.RuleModule<"forbidden", [], {
|
|
168
|
+
description: "Disallow calling the `unsubscribe` method of subjects.";
|
|
169
|
+
recommended: "recommended";
|
|
170
|
+
requiresTypeChecking: true;
|
|
171
|
+
}, TSESLint.RuleListener>;
|
|
172
|
+
'no-subject-value': TSESLint.RuleModule<"forbidden", [], {
|
|
173
|
+
description: "Disallow accessing the `value` property of a `BehaviorSubject` instance.";
|
|
174
|
+
requiresTypeChecking: true;
|
|
175
|
+
}, TSESLint.RuleListener>;
|
|
176
|
+
'no-subscribe-handlers': TSESLint.RuleModule<"forbidden", [], {
|
|
177
|
+
description: "Disallow passing handlers to `subscribe`.";
|
|
178
|
+
requiresTypeChecking: true;
|
|
179
|
+
}, TSESLint.RuleListener>;
|
|
180
|
+
'no-subscribe-in-pipe': TSESLint.RuleModule<"forbidden", [], {
|
|
181
|
+
description: "Disallow calling of `subscribe` within any RxJS operator inside a `pipe`.";
|
|
182
|
+
recommended: "recommended";
|
|
183
|
+
requiresTypeChecking: true;
|
|
184
|
+
}, TSESLint.RuleListener>;
|
|
185
|
+
'no-tap': TSESLint.RuleModule<"forbidden", [], {
|
|
186
|
+
description: "Disallow the `tap` operator.";
|
|
187
|
+
}, TSESLint.RuleListener>;
|
|
188
|
+
'no-topromise': TSESLint.RuleModule<"forbidden" | "suggestLastValueFromWithDefault" | "suggestLastValueFrom" | "suggestFirstValueFrom", [], {
|
|
189
|
+
description: "Disallow use of the `toPromise` method.";
|
|
190
|
+
recommended: "recommended";
|
|
191
|
+
requiresTypeChecking: true;
|
|
192
|
+
}, TSESLint.RuleListener>;
|
|
193
|
+
'no-unbound-methods': TSESLint.RuleModule<"forbidden", readonly {
|
|
194
|
+
allowTypes?: string[];
|
|
195
|
+
}[], {
|
|
196
|
+
description: "Disallow passing unbound methods.";
|
|
197
|
+
recommended: "recommended";
|
|
198
|
+
requiresTypeChecking: true;
|
|
199
|
+
}, TSESLint.RuleListener>;
|
|
200
|
+
'no-unsafe-catch': TSESLint.RuleModule<"forbidden", readonly {
|
|
201
|
+
observable?: string;
|
|
202
|
+
}[], {
|
|
203
|
+
description: "Disallow unsafe `catchError` usage in effects and epics.";
|
|
204
|
+
requiresTypeChecking: true;
|
|
205
|
+
}, TSESLint.RuleListener>;
|
|
206
|
+
'no-unsafe-first': TSESLint.RuleModule<"forbidden", readonly {
|
|
207
|
+
observable?: string;
|
|
208
|
+
}[], {
|
|
209
|
+
description: "Disallow unsafe `first`/`take` usage in effects and epics.";
|
|
210
|
+
requiresTypeChecking: true;
|
|
211
|
+
}, TSESLint.RuleListener>;
|
|
212
|
+
'no-unsafe-subject-next': TSESLint.RuleModule<"forbidden", [], {
|
|
213
|
+
description: "Disallow unsafe optional `next` calls.";
|
|
214
|
+
recommended: "recommended";
|
|
215
|
+
requiresTypeChecking: true;
|
|
216
|
+
}, TSESLint.RuleListener>;
|
|
217
|
+
'no-unsafe-switchmap': TSESLint.RuleModule<"forbidden", readonly {
|
|
218
|
+
allow?: string | string[];
|
|
219
|
+
disallow?: string | string[];
|
|
220
|
+
observable?: string;
|
|
221
|
+
}[], {
|
|
222
|
+
description: "Disallow unsafe `switchMap` usage in effects and epics.";
|
|
223
|
+
requiresTypeChecking: true;
|
|
224
|
+
}, TSESLint.RuleListener>;
|
|
225
|
+
'no-unsafe-takeuntil': TSESLint.RuleModule<"forbidden", readonly {
|
|
226
|
+
alias?: string[];
|
|
227
|
+
allow?: string[];
|
|
228
|
+
}[], {
|
|
229
|
+
description: "Disallow applying operators after `takeUntil`.";
|
|
230
|
+
recommended: "recommended";
|
|
231
|
+
requiresTypeChecking: true;
|
|
232
|
+
}, TSESLint.RuleListener>;
|
|
233
|
+
'prefer-observer': TSESLint.RuleModule<"forbidden", readonly {
|
|
234
|
+
allowNext?: boolean;
|
|
235
|
+
}[], {
|
|
236
|
+
description: "Disallow passing separate handlers to `subscribe` and `tap`.";
|
|
237
|
+
recommended: "recommended";
|
|
238
|
+
requiresTypeChecking: true;
|
|
239
|
+
}, TSESLint.RuleListener>;
|
|
240
|
+
'prefer-root-operators': TSESLint.RuleModule<"forbidden" | "suggest" | "forbiddenWithoutFix", [], {
|
|
241
|
+
description: "Disallow importing operators from `rxjs/operators`.";
|
|
242
|
+
recommended: "recommended";
|
|
243
|
+
}, TSESLint.RuleListener>;
|
|
244
|
+
'suffix-subjects': TSESLint.RuleModule<"forbidden", readonly {
|
|
245
|
+
parameters?: boolean;
|
|
246
|
+
properties?: boolean;
|
|
247
|
+
suffix?: string;
|
|
248
|
+
types?: Record<string, boolean>;
|
|
249
|
+
variables?: boolean;
|
|
250
|
+
}[], {
|
|
251
|
+
description: "Enforce the use of a suffix in subject identifiers.";
|
|
252
|
+
requiresTypeChecking: true;
|
|
253
|
+
}, TSESLint.RuleListener>;
|
|
254
|
+
'throw-error': TSESLint.RuleModule<"forbidden", readonly {
|
|
255
|
+
allowThrowingAny?: boolean;
|
|
256
|
+
allowThrowingUnknown?: boolean;
|
|
257
|
+
}[], {
|
|
258
|
+
description: "Enforce passing only `Error` values to `throwError` or `Subject.error`.";
|
|
259
|
+
recommended: {
|
|
260
|
+
recommended: true;
|
|
261
|
+
strict: [{
|
|
262
|
+
allowThrowingAny: boolean;
|
|
263
|
+
allowThrowingUnknown: boolean;
|
|
264
|
+
}];
|
|
265
|
+
};
|
|
266
|
+
requiresTypeChecking: true;
|
|
267
|
+
}, TSESLint.RuleListener>;
|
|
268
|
+
};
|
|
18
269
|
declare const rxjsX: {
|
|
19
270
|
configs: {
|
|
20
271
|
recommended: {
|
|
21
272
|
name: "rxjs-x/recommended";
|
|
22
273
|
plugins: {
|
|
23
|
-
'rxjs-x':
|
|
274
|
+
'rxjs-x': ESLint.Plugin;
|
|
24
275
|
};
|
|
25
276
|
rules: {
|
|
26
277
|
'rxjs-x/no-async-subscribe': "error";
|
|
@@ -48,7 +299,7 @@ declare const rxjsX: {
|
|
|
48
299
|
strict: {
|
|
49
300
|
name: "rxjs-x/strict";
|
|
50
301
|
plugins: {
|
|
51
|
-
'rxjs-x':
|
|
302
|
+
'rxjs-x': ESLint.Plugin;
|
|
52
303
|
};
|
|
53
304
|
rules: {
|
|
54
305
|
'rxjs-x/no-async-subscribe': "error";
|
|
@@ -89,102 +340,8 @@ declare const rxjsX: {
|
|
|
89
340
|
name: string;
|
|
90
341
|
version: string;
|
|
91
342
|
};
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
'ban-operators': TSESLint.RuleModule<"forbidden", readonly Record<string, string | boolean>[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
95
|
-
finnish: TSESLint.RuleModule<"shouldBeFinnish" | "shouldNotBeFinnish", readonly {
|
|
96
|
-
functions?: boolean;
|
|
97
|
-
methods?: boolean;
|
|
98
|
-
names?: Record<string, boolean>;
|
|
99
|
-
parameters?: boolean;
|
|
100
|
-
properties?: boolean;
|
|
101
|
-
strict?: boolean;
|
|
102
|
-
types?: Record<string, boolean>;
|
|
103
|
-
variables?: boolean;
|
|
104
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
105
|
-
just: TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
106
|
-
macro: TSESLint.RuleModule<"macro", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
107
|
-
'no-async-subscribe': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
108
|
-
'no-compat': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
109
|
-
'no-connectable': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
110
|
-
'no-create': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
111
|
-
'no-cyclic-action': TSESLint.RuleModule<"forbidden", readonly {
|
|
112
|
-
observable?: string;
|
|
113
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
114
|
-
'no-explicit-generics': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
115
|
-
'no-exposed-subjects': TSESLint.RuleModule<"forbidden" | "forbiddenAllowProtected", readonly {
|
|
116
|
-
allowProtected?: boolean;
|
|
117
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
118
|
-
'no-finnish': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
119
|
-
'no-floating-observables': TSESLint.RuleModule<"forbidden" | "forbiddenNoVoid", readonly {
|
|
120
|
-
ignoreVoid?: boolean;
|
|
121
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
122
|
-
'no-ignored-default-value': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
123
|
-
'no-ignored-error': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
124
|
-
'no-ignored-notifier': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
125
|
-
'no-ignored-replay-buffer': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
126
|
-
'no-ignored-subscribe': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
127
|
-
'no-ignored-subscription': TSESLint.RuleModule<"forbidden", readonly {
|
|
128
|
-
completers?: string[];
|
|
129
|
-
postCompleters?: string[];
|
|
130
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
131
|
-
'no-ignored-takewhile-value': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
132
|
-
'no-implicit-any-catch': TSESLint.RuleModule<"explicitAny" | "implicitAny" | "narrowed" | "suggestExplicitUnknown", readonly {
|
|
133
|
-
allowExplicitAny?: boolean;
|
|
134
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
135
|
-
'no-index': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
136
|
-
'no-internal': TSESLint.RuleModule<"forbidden" | "suggest", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
137
|
-
'no-misused-observables': TSESLint.RuleModule<"forbiddenVoidReturnArgument" | "forbiddenVoidReturnAttribute" | "forbiddenVoidReturnInheritedMethod" | "forbiddenVoidReturnProperty" | "forbiddenVoidReturnReturnValue" | "forbiddenVoidReturnVariable" | "forbiddenSpread", readonly {
|
|
138
|
-
checksVoidReturn?: boolean | ChecksVoidReturnOptions;
|
|
139
|
-
checksSpreads?: boolean;
|
|
140
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
141
|
-
'no-nested-subscribe': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
142
|
-
'no-redundant-notify': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
143
|
-
'no-sharereplay': TSESLint.RuleModule<"forbidden" | "forbiddenWithoutConfig", readonly {
|
|
144
|
-
allowConfig?: boolean;
|
|
145
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
146
|
-
'no-subclass': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
147
|
-
'no-subject-unsubscribe': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
148
|
-
'no-subject-value': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
149
|
-
'no-subscribe-handlers': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
150
|
-
'no-subscribe-in-pipe': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
151
|
-
'no-tap': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
152
|
-
'no-topromise': TSESLint.RuleModule<"forbidden" | "suggestLastValueFromWithDefault" | "suggestLastValueFrom" | "suggestFirstValueFrom", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
153
|
-
'no-unbound-methods': TSESLint.RuleModule<"forbidden", readonly {
|
|
154
|
-
allowTypes?: string[];
|
|
155
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
156
|
-
'no-unsafe-catch': TSESLint.RuleModule<"forbidden", readonly {
|
|
157
|
-
observable?: string;
|
|
158
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
159
|
-
'no-unsafe-first': TSESLint.RuleModule<"forbidden", readonly {
|
|
160
|
-
observable?: string;
|
|
161
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
162
|
-
'no-unsafe-subject-next': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
163
|
-
'no-unsafe-switchmap': TSESLint.RuleModule<"forbidden", readonly {
|
|
164
|
-
allow?: string | string[];
|
|
165
|
-
disallow?: string | string[];
|
|
166
|
-
observable?: string;
|
|
167
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
168
|
-
'no-unsafe-takeuntil': TSESLint.RuleModule<"forbidden", readonly {
|
|
169
|
-
alias?: string[];
|
|
170
|
-
allow?: string[];
|
|
171
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
172
|
-
'prefer-observer': TSESLint.RuleModule<"forbidden", readonly {
|
|
173
|
-
allowNext?: boolean;
|
|
174
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
175
|
-
'prefer-root-operators': TSESLint.RuleModule<"forbidden" | "suggest" | "forbiddenWithoutFix", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
176
|
-
'suffix-subjects': TSESLint.RuleModule<"forbidden", readonly {
|
|
177
|
-
parameters?: boolean;
|
|
178
|
-
properties?: boolean;
|
|
179
|
-
suffix?: string;
|
|
180
|
-
types?: Record<string, boolean>;
|
|
181
|
-
variables?: boolean;
|
|
182
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
183
|
-
'throw-error': TSESLint.RuleModule<"forbidden", readonly {
|
|
184
|
-
allowThrowingAny?: boolean;
|
|
185
|
-
allowThrowingUnknown?: boolean;
|
|
186
|
-
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
187
|
-
};
|
|
343
|
+
/** Compatibility with `defineConfig` until https://github.com/typescript-eslint/typescript-eslint/issues/11543 is addressed. */
|
|
344
|
+
rules: { [K in keyof typeof allRules]: (typeof allRules)[K] & Rule.RuleModule; };
|
|
188
345
|
};
|
|
189
346
|
|
|
190
347
|
export = rxjsX;
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// package.json
|
|
2
2
|
var name = "eslint-plugin-rxjs-x";
|
|
3
|
-
var version = "0.
|
|
3
|
+
var version = "0.8.0";
|
|
4
4
|
|
|
5
5
|
// src/configs/recommended.ts
|
|
6
6
|
var createRecommendedConfig = (plugin2) => ({
|
|
7
7
|
name: "rxjs-x/recommended",
|
|
8
8
|
plugins: {
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- "A type annotation is necessary."
|
|
9
10
|
"rxjs-x": plugin2
|
|
10
11
|
},
|
|
11
12
|
rules: {
|
|
@@ -36,6 +37,7 @@ var createRecommendedConfig = (plugin2) => ({
|
|
|
36
37
|
var createStrictConfig = (plugin2) => ({
|
|
37
38
|
name: "rxjs-x/strict",
|
|
38
39
|
plugins: {
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- "A type annotation is necessary."
|
|
39
41
|
"rxjs-x": plugin2
|
|
40
42
|
},
|
|
41
43
|
rules: {
|
|
@@ -438,6 +440,7 @@ function isSourcesObjectAcceptingStaticObservableCreator(expression) {
|
|
|
438
440
|
var REPO_URL = "https://github.com/JasonWeinzierl/eslint-plugin-rxjs-x";
|
|
439
441
|
var ruleCreator = _utils.ESLintUtils.RuleCreator(
|
|
440
442
|
(name2) => `${REPO_URL}/blob/v${version}/docs/rules/${name2}.md`
|
|
443
|
+
// Ensure the resulting types are narrowed to exactly what each rule declares.
|
|
441
444
|
);
|
|
442
445
|
|
|
443
446
|
// src/rules/ban-observables.ts
|
|
@@ -4126,55 +4129,57 @@ var throwErrorRule = ruleCreator({
|
|
|
4126
4129
|
});
|
|
4127
4130
|
|
|
4128
4131
|
// src/index.ts
|
|
4132
|
+
var allRules = {
|
|
4133
|
+
"ban-observables": banObservablesRule,
|
|
4134
|
+
"ban-operators": banOperatorsRule,
|
|
4135
|
+
"finnish": finnishRule,
|
|
4136
|
+
"just": justRule,
|
|
4137
|
+
"macro": macroRule,
|
|
4138
|
+
"no-async-subscribe": noAsyncSubscribeRule,
|
|
4139
|
+
"no-compat": noCompatRule,
|
|
4140
|
+
"no-connectable": noConnectableRule,
|
|
4141
|
+
"no-create": noCreateRule,
|
|
4142
|
+
"no-cyclic-action": noCyclicActionRule,
|
|
4143
|
+
"no-explicit-generics": noExplicitGenericsRule,
|
|
4144
|
+
"no-exposed-subjects": noExposedSubjectsRule,
|
|
4145
|
+
"no-finnish": noFinnishRule,
|
|
4146
|
+
"no-floating-observables": noFloatingObservablesRule,
|
|
4147
|
+
"no-ignored-default-value": noIgnoredDefaultValueRule,
|
|
4148
|
+
"no-ignored-error": noIgnoredErrorRule,
|
|
4149
|
+
"no-ignored-notifier": noIgnoredNotifierRule,
|
|
4150
|
+
"no-ignored-replay-buffer": noIgnoredReplayBufferRule,
|
|
4151
|
+
"no-ignored-subscribe": noIgnoredSubscribeRule,
|
|
4152
|
+
"no-ignored-subscription": noIgnoredSubscriptionRule,
|
|
4153
|
+
"no-ignored-takewhile-value": noIgnoredTakewhileValueRule,
|
|
4154
|
+
"no-implicit-any-catch": noImplicitAnyCatchRule,
|
|
4155
|
+
"no-index": noIndexRule,
|
|
4156
|
+
"no-internal": noInternalRule,
|
|
4157
|
+
"no-misused-observables": noMisusedObservablesRule,
|
|
4158
|
+
"no-nested-subscribe": noNestedSubscribeRule,
|
|
4159
|
+
"no-redundant-notify": noRedundantNotifyRule,
|
|
4160
|
+
"no-sharereplay": noSharereplayRule,
|
|
4161
|
+
"no-subclass": noSubclassRule,
|
|
4162
|
+
"no-subject-unsubscribe": noSubjectUnsubscribeRule,
|
|
4163
|
+
"no-subject-value": noSubjectValueRule,
|
|
4164
|
+
"no-subscribe-handlers": noSubscribeHandlersRule,
|
|
4165
|
+
"no-subscribe-in-pipe": noSubscribeInPipeRule,
|
|
4166
|
+
"no-tap": noTapRule,
|
|
4167
|
+
"no-topromise": noTopromiseRule,
|
|
4168
|
+
"no-unbound-methods": noUnboundMethodsRule,
|
|
4169
|
+
"no-unsafe-catch": noUnsafeCatchRule,
|
|
4170
|
+
"no-unsafe-first": noUnsafeFirstRule,
|
|
4171
|
+
"no-unsafe-subject-next": noUnsafeSubjectNext,
|
|
4172
|
+
"no-unsafe-switchmap": noUnsafeSwitchmapRule,
|
|
4173
|
+
"no-unsafe-takeuntil": noUnsafeTakeuntilRule,
|
|
4174
|
+
"prefer-observer": preferObserverRule,
|
|
4175
|
+
"prefer-root-operators": preferRootOperatorsRule,
|
|
4176
|
+
"suffix-subjects": suffixSubjectsRule,
|
|
4177
|
+
"throw-error": throwErrorRule
|
|
4178
|
+
};
|
|
4129
4179
|
var plugin = {
|
|
4130
4180
|
meta: { name, version },
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
"ban-operators": banOperatorsRule,
|
|
4134
|
-
"finnish": finnishRule,
|
|
4135
|
-
"just": justRule,
|
|
4136
|
-
"macro": macroRule,
|
|
4137
|
-
"no-async-subscribe": noAsyncSubscribeRule,
|
|
4138
|
-
"no-compat": noCompatRule,
|
|
4139
|
-
"no-connectable": noConnectableRule,
|
|
4140
|
-
"no-create": noCreateRule,
|
|
4141
|
-
"no-cyclic-action": noCyclicActionRule,
|
|
4142
|
-
"no-explicit-generics": noExplicitGenericsRule,
|
|
4143
|
-
"no-exposed-subjects": noExposedSubjectsRule,
|
|
4144
|
-
"no-finnish": noFinnishRule,
|
|
4145
|
-
"no-floating-observables": noFloatingObservablesRule,
|
|
4146
|
-
"no-ignored-default-value": noIgnoredDefaultValueRule,
|
|
4147
|
-
"no-ignored-error": noIgnoredErrorRule,
|
|
4148
|
-
"no-ignored-notifier": noIgnoredNotifierRule,
|
|
4149
|
-
"no-ignored-replay-buffer": noIgnoredReplayBufferRule,
|
|
4150
|
-
"no-ignored-subscribe": noIgnoredSubscribeRule,
|
|
4151
|
-
"no-ignored-subscription": noIgnoredSubscriptionRule,
|
|
4152
|
-
"no-ignored-takewhile-value": noIgnoredTakewhileValueRule,
|
|
4153
|
-
"no-implicit-any-catch": noImplicitAnyCatchRule,
|
|
4154
|
-
"no-index": noIndexRule,
|
|
4155
|
-
"no-internal": noInternalRule,
|
|
4156
|
-
"no-misused-observables": noMisusedObservablesRule,
|
|
4157
|
-
"no-nested-subscribe": noNestedSubscribeRule,
|
|
4158
|
-
"no-redundant-notify": noRedundantNotifyRule,
|
|
4159
|
-
"no-sharereplay": noSharereplayRule,
|
|
4160
|
-
"no-subclass": noSubclassRule,
|
|
4161
|
-
"no-subject-unsubscribe": noSubjectUnsubscribeRule,
|
|
4162
|
-
"no-subject-value": noSubjectValueRule,
|
|
4163
|
-
"no-subscribe-handlers": noSubscribeHandlersRule,
|
|
4164
|
-
"no-subscribe-in-pipe": noSubscribeInPipeRule,
|
|
4165
|
-
"no-tap": noTapRule,
|
|
4166
|
-
"no-topromise": noTopromiseRule,
|
|
4167
|
-
"no-unbound-methods": noUnboundMethodsRule,
|
|
4168
|
-
"no-unsafe-catch": noUnsafeCatchRule,
|
|
4169
|
-
"no-unsafe-first": noUnsafeFirstRule,
|
|
4170
|
-
"no-unsafe-subject-next": noUnsafeSubjectNext,
|
|
4171
|
-
"no-unsafe-switchmap": noUnsafeSwitchmapRule,
|
|
4172
|
-
"no-unsafe-takeuntil": noUnsafeTakeuntilRule,
|
|
4173
|
-
"prefer-observer": preferObserverRule,
|
|
4174
|
-
"prefer-root-operators": preferRootOperatorsRule,
|
|
4175
|
-
"suffix-subjects": suffixSubjectsRule,
|
|
4176
|
-
"throw-error": throwErrorRule
|
|
4177
|
-
}
|
|
4181
|
+
/** Compatibility with `defineConfig` until https://github.com/typescript-eslint/typescript-eslint/issues/11543 is addressed. */
|
|
4182
|
+
rules: allRules
|
|
4178
4183
|
};
|
|
4179
4184
|
var rxjsX = {
|
|
4180
4185
|
...plugin,
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var name = "eslint-plugin-rxjs-x";
|
|
3
|
-
var version = "0.
|
|
3
|
+
var version = "0.8.0";
|
|
4
4
|
|
|
5
5
|
// src/configs/recommended.ts
|
|
6
6
|
var createRecommendedConfig = (plugin2) => ({
|
|
7
7
|
name: "rxjs-x/recommended",
|
|
8
8
|
plugins: {
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- "A type annotation is necessary."
|
|
9
10
|
"rxjs-x": plugin2
|
|
10
11
|
},
|
|
11
12
|
rules: {
|
|
@@ -36,6 +37,7 @@ var createRecommendedConfig = (plugin2) => ({
|
|
|
36
37
|
var createStrictConfig = (plugin2) => ({
|
|
37
38
|
name: "rxjs-x/strict",
|
|
38
39
|
plugins: {
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- "A type annotation is necessary."
|
|
39
41
|
"rxjs-x": plugin2
|
|
40
42
|
},
|
|
41
43
|
rules: {
|
|
@@ -438,6 +440,7 @@ import { ESLintUtils as ESLintUtils2 } from "@typescript-eslint/utils";
|
|
|
438
440
|
var REPO_URL = "https://github.com/JasonWeinzierl/eslint-plugin-rxjs-x";
|
|
439
441
|
var ruleCreator = ESLintUtils2.RuleCreator(
|
|
440
442
|
(name2) => `${REPO_URL}/blob/v${version}/docs/rules/${name2}.md`
|
|
443
|
+
// Ensure the resulting types are narrowed to exactly what each rule declares.
|
|
441
444
|
);
|
|
442
445
|
|
|
443
446
|
// src/rules/ban-observables.ts
|
|
@@ -4126,55 +4129,57 @@ var throwErrorRule = ruleCreator({
|
|
|
4126
4129
|
});
|
|
4127
4130
|
|
|
4128
4131
|
// src/index.ts
|
|
4132
|
+
var allRules = {
|
|
4133
|
+
"ban-observables": banObservablesRule,
|
|
4134
|
+
"ban-operators": banOperatorsRule,
|
|
4135
|
+
"finnish": finnishRule,
|
|
4136
|
+
"just": justRule,
|
|
4137
|
+
"macro": macroRule,
|
|
4138
|
+
"no-async-subscribe": noAsyncSubscribeRule,
|
|
4139
|
+
"no-compat": noCompatRule,
|
|
4140
|
+
"no-connectable": noConnectableRule,
|
|
4141
|
+
"no-create": noCreateRule,
|
|
4142
|
+
"no-cyclic-action": noCyclicActionRule,
|
|
4143
|
+
"no-explicit-generics": noExplicitGenericsRule,
|
|
4144
|
+
"no-exposed-subjects": noExposedSubjectsRule,
|
|
4145
|
+
"no-finnish": noFinnishRule,
|
|
4146
|
+
"no-floating-observables": noFloatingObservablesRule,
|
|
4147
|
+
"no-ignored-default-value": noIgnoredDefaultValueRule,
|
|
4148
|
+
"no-ignored-error": noIgnoredErrorRule,
|
|
4149
|
+
"no-ignored-notifier": noIgnoredNotifierRule,
|
|
4150
|
+
"no-ignored-replay-buffer": noIgnoredReplayBufferRule,
|
|
4151
|
+
"no-ignored-subscribe": noIgnoredSubscribeRule,
|
|
4152
|
+
"no-ignored-subscription": noIgnoredSubscriptionRule,
|
|
4153
|
+
"no-ignored-takewhile-value": noIgnoredTakewhileValueRule,
|
|
4154
|
+
"no-implicit-any-catch": noImplicitAnyCatchRule,
|
|
4155
|
+
"no-index": noIndexRule,
|
|
4156
|
+
"no-internal": noInternalRule,
|
|
4157
|
+
"no-misused-observables": noMisusedObservablesRule,
|
|
4158
|
+
"no-nested-subscribe": noNestedSubscribeRule,
|
|
4159
|
+
"no-redundant-notify": noRedundantNotifyRule,
|
|
4160
|
+
"no-sharereplay": noSharereplayRule,
|
|
4161
|
+
"no-subclass": noSubclassRule,
|
|
4162
|
+
"no-subject-unsubscribe": noSubjectUnsubscribeRule,
|
|
4163
|
+
"no-subject-value": noSubjectValueRule,
|
|
4164
|
+
"no-subscribe-handlers": noSubscribeHandlersRule,
|
|
4165
|
+
"no-subscribe-in-pipe": noSubscribeInPipeRule,
|
|
4166
|
+
"no-tap": noTapRule,
|
|
4167
|
+
"no-topromise": noTopromiseRule,
|
|
4168
|
+
"no-unbound-methods": noUnboundMethodsRule,
|
|
4169
|
+
"no-unsafe-catch": noUnsafeCatchRule,
|
|
4170
|
+
"no-unsafe-first": noUnsafeFirstRule,
|
|
4171
|
+
"no-unsafe-subject-next": noUnsafeSubjectNext,
|
|
4172
|
+
"no-unsafe-switchmap": noUnsafeSwitchmapRule,
|
|
4173
|
+
"no-unsafe-takeuntil": noUnsafeTakeuntilRule,
|
|
4174
|
+
"prefer-observer": preferObserverRule,
|
|
4175
|
+
"prefer-root-operators": preferRootOperatorsRule,
|
|
4176
|
+
"suffix-subjects": suffixSubjectsRule,
|
|
4177
|
+
"throw-error": throwErrorRule
|
|
4178
|
+
};
|
|
4129
4179
|
var plugin = {
|
|
4130
4180
|
meta: { name, version },
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
"ban-operators": banOperatorsRule,
|
|
4134
|
-
"finnish": finnishRule,
|
|
4135
|
-
"just": justRule,
|
|
4136
|
-
"macro": macroRule,
|
|
4137
|
-
"no-async-subscribe": noAsyncSubscribeRule,
|
|
4138
|
-
"no-compat": noCompatRule,
|
|
4139
|
-
"no-connectable": noConnectableRule,
|
|
4140
|
-
"no-create": noCreateRule,
|
|
4141
|
-
"no-cyclic-action": noCyclicActionRule,
|
|
4142
|
-
"no-explicit-generics": noExplicitGenericsRule,
|
|
4143
|
-
"no-exposed-subjects": noExposedSubjectsRule,
|
|
4144
|
-
"no-finnish": noFinnishRule,
|
|
4145
|
-
"no-floating-observables": noFloatingObservablesRule,
|
|
4146
|
-
"no-ignored-default-value": noIgnoredDefaultValueRule,
|
|
4147
|
-
"no-ignored-error": noIgnoredErrorRule,
|
|
4148
|
-
"no-ignored-notifier": noIgnoredNotifierRule,
|
|
4149
|
-
"no-ignored-replay-buffer": noIgnoredReplayBufferRule,
|
|
4150
|
-
"no-ignored-subscribe": noIgnoredSubscribeRule,
|
|
4151
|
-
"no-ignored-subscription": noIgnoredSubscriptionRule,
|
|
4152
|
-
"no-ignored-takewhile-value": noIgnoredTakewhileValueRule,
|
|
4153
|
-
"no-implicit-any-catch": noImplicitAnyCatchRule,
|
|
4154
|
-
"no-index": noIndexRule,
|
|
4155
|
-
"no-internal": noInternalRule,
|
|
4156
|
-
"no-misused-observables": noMisusedObservablesRule,
|
|
4157
|
-
"no-nested-subscribe": noNestedSubscribeRule,
|
|
4158
|
-
"no-redundant-notify": noRedundantNotifyRule,
|
|
4159
|
-
"no-sharereplay": noSharereplayRule,
|
|
4160
|
-
"no-subclass": noSubclassRule,
|
|
4161
|
-
"no-subject-unsubscribe": noSubjectUnsubscribeRule,
|
|
4162
|
-
"no-subject-value": noSubjectValueRule,
|
|
4163
|
-
"no-subscribe-handlers": noSubscribeHandlersRule,
|
|
4164
|
-
"no-subscribe-in-pipe": noSubscribeInPipeRule,
|
|
4165
|
-
"no-tap": noTapRule,
|
|
4166
|
-
"no-topromise": noTopromiseRule,
|
|
4167
|
-
"no-unbound-methods": noUnboundMethodsRule,
|
|
4168
|
-
"no-unsafe-catch": noUnsafeCatchRule,
|
|
4169
|
-
"no-unsafe-first": noUnsafeFirstRule,
|
|
4170
|
-
"no-unsafe-subject-next": noUnsafeSubjectNext,
|
|
4171
|
-
"no-unsafe-switchmap": noUnsafeSwitchmapRule,
|
|
4172
|
-
"no-unsafe-takeuntil": noUnsafeTakeuntilRule,
|
|
4173
|
-
"prefer-observer": preferObserverRule,
|
|
4174
|
-
"prefer-root-operators": preferRootOperatorsRule,
|
|
4175
|
-
"suffix-subjects": suffixSubjectsRule,
|
|
4176
|
-
"throw-error": throwErrorRule
|
|
4177
|
-
}
|
|
4181
|
+
/** Compatibility with `defineConfig` until https://github.com/typescript-eslint/typescript-eslint/issues/11543 is addressed. */
|
|
4182
|
+
rules: allRules
|
|
4178
4183
|
};
|
|
4179
4184
|
var rxjsX = {
|
|
4180
4185
|
...plugin,
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-rxjs-x",
|
|
3
3
|
"type": "commonjs",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "yarn@4.
|
|
4
|
+
"version": "0.8.0",
|
|
5
|
+
"packageManager": "yarn@4.10.3+sha512.c38cafb5c7bb273f3926d04e55e1d8c9dfa7d9c3ea1f36a4868fa028b9e5f72298f0b7f401ad5eb921749eb012eb1c3bb74bf7503df3ee43fd600d14a018266f",
|
|
6
6
|
"description": "ESLint v9+ plugin for RxJS",
|
|
7
7
|
"author": "Jason Weinzierl <weinzierljason@gmail.com>",
|
|
8
8
|
"license": "MIT",
|
|
@@ -72,27 +72,28 @@
|
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@eslint/
|
|
76
|
-
"@
|
|
75
|
+
"@eslint/config-helpers": "0.4.1",
|
|
76
|
+
"@eslint/js": "^9.38.0",
|
|
77
|
+
"@stylistic/eslint-plugin": "^5.5.0",
|
|
77
78
|
"@types/common-tags": "^1.8.4",
|
|
78
79
|
"@types/node": "~18.18.0",
|
|
79
|
-
"@typescript-eslint/rule-tester": "^8.
|
|
80
|
+
"@typescript-eslint/rule-tester": "^8.46.2",
|
|
80
81
|
"@typescript/vfs": "^1.6.1",
|
|
81
82
|
"@vitest/coverage-v8": "^3.2.4",
|
|
82
|
-
"@vitest/eslint-plugin": "^1.
|
|
83
|
-
"bumpp": "^10.
|
|
84
|
-
"eslint": "^9.
|
|
83
|
+
"@vitest/eslint-plugin": "^1.4.0",
|
|
84
|
+
"bumpp": "^10.3.1",
|
|
85
|
+
"eslint": "^9.38.0",
|
|
85
86
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
86
|
-
"eslint-doc-generator": "
|
|
87
|
-
"eslint-import-resolver-typescript": "^4.4.
|
|
88
|
-
"eslint-plugin-eslint-plugin": "^
|
|
89
|
-
"eslint-plugin-import-x": "^4.
|
|
90
|
-
"eslint-plugin-n": "^17.
|
|
87
|
+
"eslint-doc-generator": "~2.2.2",
|
|
88
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
89
|
+
"eslint-plugin-eslint-plugin": "^7.2.0",
|
|
90
|
+
"eslint-plugin-import-x": "^4.16.1",
|
|
91
|
+
"eslint-plugin-n": "^17.23.1",
|
|
91
92
|
"markdownlint-cli2": "^0.18.1",
|
|
92
93
|
"rxjs": "^7.8.2",
|
|
93
94
|
"tsup": "^8.5.0",
|
|
94
95
|
"typescript": "~5.8.3",
|
|
95
|
-
"typescript-eslint": "^8.
|
|
96
|
+
"typescript-eslint": "^8.46.2",
|
|
96
97
|
"vite": "^6.3.5",
|
|
97
98
|
"vitest": "^3.2.4"
|
|
98
99
|
},
|