eslint-plugin-rxjs-x 0.5.0 → 0.6.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 +2 -0
- package/dist/index.d.mts +19 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +487 -26
- package/dist/index.mjs +501 -40
- package/docs/rules/no-floating-observables.md +1 -0
- package/docs/rules/no-misused-observables.md +85 -0
- package/docs/rules/no-subscribe-in-pipe.md +37 -0
- package/package.json +11 -9
package/README.md
CHANGED
|
@@ -100,6 +100,7 @@ The package includes the following rules.
|
|
|
100
100
|
| [no-implicit-any-catch](docs/rules/no-implicit-any-catch.md) | Disallow implicit `any` error parameters in `catchError` operators. | ✅ 🔒 | 🔧 | 💡 | 💭 | |
|
|
101
101
|
| [no-index](docs/rules/no-index.md) | Disallow importing index modules. | ✅ 🔒 | | | | |
|
|
102
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. | 🔒 | | | 💭 | |
|
|
103
104
|
| [no-nested-subscribe](docs/rules/no-nested-subscribe.md) | Disallow calling `subscribe` within a `subscribe` callback. | ✅ 🔒 | | | 💭 | |
|
|
104
105
|
| [no-redundant-notify](docs/rules/no-redundant-notify.md) | Disallow sending redundant notifications from completed or errored observables. | ✅ 🔒 | | | 💭 | |
|
|
105
106
|
| [no-sharereplay](docs/rules/no-sharereplay.md) | Disallow unsafe `shareReplay` usage. | ✅ 🔒 | | | | |
|
|
@@ -107,6 +108,7 @@ The package includes the following rules.
|
|
|
107
108
|
| [no-subject-unsubscribe](docs/rules/no-subject-unsubscribe.md) | Disallow calling the `unsubscribe` method of subjects. | ✅ 🔒 | | | 💭 | |
|
|
108
109
|
| [no-subject-value](docs/rules/no-subject-value.md) | Disallow accessing the `value` property of a `BehaviorSubject` instance. | | | | 💭 | |
|
|
109
110
|
| [no-subscribe-handlers](docs/rules/no-subscribe-handlers.md) | Disallow passing handlers to `subscribe`. | | | | 💭 | |
|
|
111
|
+
| [no-subscribe-in-pipe](docs/rules/no-subscribe-in-pipe.md) | Disallow calling of `subscribe` within any RxJS operator inside a `pipe`. | ✅ 🔒 | | | 💭 | |
|
|
110
112
|
| [no-tap](docs/rules/no-tap.md) | Disallow the `tap` operator. | | | | | ❌ |
|
|
111
113
|
| [no-topromise](docs/rules/no-topromise.md) | Disallow use of the `toPromise` method. | ✅ 🔒 | | 💡 | 💭 | |
|
|
112
114
|
| [no-unbound-methods](docs/rules/no-unbound-methods.md) | Disallow passing unbound methods. | ✅ 🔒 | | | 💭 | |
|
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,6 +35,7 @@ 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-subscribe-in-pipe': "error";
|
|
28
39
|
'rxjs-x/no-topromise': "error";
|
|
29
40
|
'rxjs-x/no-unbound-methods': "error";
|
|
30
41
|
'rxjs-x/no-unsafe-subject-next': "error";
|
|
@@ -35,6 +46,7 @@ declare const rxjsX: {
|
|
|
35
46
|
};
|
|
36
47
|
};
|
|
37
48
|
strict: {
|
|
49
|
+
name: "rxjs-x/strict";
|
|
38
50
|
plugins: {
|
|
39
51
|
'rxjs-x': TSESLint.FlatConfig.Plugin;
|
|
40
52
|
};
|
|
@@ -54,11 +66,13 @@ declare const rxjsX: {
|
|
|
54
66
|
}];
|
|
55
67
|
'rxjs-x/no-index': "error";
|
|
56
68
|
'rxjs-x/no-internal': "error";
|
|
69
|
+
'rxjs-x/no-misused-observables': "error";
|
|
57
70
|
'rxjs-x/no-nested-subscribe': "error";
|
|
58
71
|
'rxjs-x/no-redundant-notify': "error";
|
|
59
72
|
'rxjs-x/no-sharereplay': "error";
|
|
60
73
|
'rxjs-x/no-subclass': "error";
|
|
61
74
|
'rxjs-x/no-subject-unsubscribe': "error";
|
|
75
|
+
'rxjs-x/no-subscribe-in-pipe': "error";
|
|
62
76
|
'rxjs-x/no-topromise': "error";
|
|
63
77
|
'rxjs-x/no-unbound-methods': "error";
|
|
64
78
|
'rxjs-x/no-unsafe-subject-next': "error";
|
|
@@ -118,6 +132,10 @@ declare const rxjsX: {
|
|
|
118
132
|
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
119
133
|
'no-index': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
120
134
|
'no-internal': TSESLint.RuleModule<"forbidden" | "suggest", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
135
|
+
'no-misused-observables': TSESLint.RuleModule<"forbiddenVoidReturnArgument" | "forbiddenVoidReturnAttribute" | "forbiddenVoidReturnInheritedMethod" | "forbiddenVoidReturnProperty" | "forbiddenVoidReturnReturnValue" | "forbiddenVoidReturnVariable" | "forbiddenSpread", readonly {
|
|
136
|
+
checksVoidReturn?: boolean | ChecksVoidReturnOptions;
|
|
137
|
+
checksSpreads?: boolean;
|
|
138
|
+
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
121
139
|
'no-nested-subscribe': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
122
140
|
'no-redundant-notify': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
123
141
|
'no-sharereplay': TSESLint.RuleModule<"forbidden" | "forbiddenWithoutConfig", readonly {
|
|
@@ -127,6 +145,7 @@ declare const rxjsX: {
|
|
|
127
145
|
'no-subject-unsubscribe': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
128
146
|
'no-subject-value': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
129
147
|
'no-subscribe-handlers': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
148
|
+
'no-subscribe-in-pipe': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
130
149
|
'no-tap': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
131
150
|
'no-topromise': TSESLint.RuleModule<"forbidden" | "suggestLastValueFrom" | "suggestFirstValueFrom", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
132
151
|
'no-unbound-methods': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
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,6 +35,7 @@ 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-subscribe-in-pipe': "error";
|
|
28
39
|
'rxjs-x/no-topromise': "error";
|
|
29
40
|
'rxjs-x/no-unbound-methods': "error";
|
|
30
41
|
'rxjs-x/no-unsafe-subject-next': "error";
|
|
@@ -35,6 +46,7 @@ declare const rxjsX: {
|
|
|
35
46
|
};
|
|
36
47
|
};
|
|
37
48
|
strict: {
|
|
49
|
+
name: "rxjs-x/strict";
|
|
38
50
|
plugins: {
|
|
39
51
|
'rxjs-x': TSESLint.FlatConfig.Plugin;
|
|
40
52
|
};
|
|
@@ -54,11 +66,13 @@ declare const rxjsX: {
|
|
|
54
66
|
}];
|
|
55
67
|
'rxjs-x/no-index': "error";
|
|
56
68
|
'rxjs-x/no-internal': "error";
|
|
69
|
+
'rxjs-x/no-misused-observables': "error";
|
|
57
70
|
'rxjs-x/no-nested-subscribe': "error";
|
|
58
71
|
'rxjs-x/no-redundant-notify': "error";
|
|
59
72
|
'rxjs-x/no-sharereplay': "error";
|
|
60
73
|
'rxjs-x/no-subclass': "error";
|
|
61
74
|
'rxjs-x/no-subject-unsubscribe': "error";
|
|
75
|
+
'rxjs-x/no-subscribe-in-pipe': "error";
|
|
62
76
|
'rxjs-x/no-topromise': "error";
|
|
63
77
|
'rxjs-x/no-unbound-methods': "error";
|
|
64
78
|
'rxjs-x/no-unsafe-subject-next': "error";
|
|
@@ -118,6 +132,10 @@ declare const rxjsX: {
|
|
|
118
132
|
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
119
133
|
'no-index': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
120
134
|
'no-internal': TSESLint.RuleModule<"forbidden" | "suggest", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
135
|
+
'no-misused-observables': TSESLint.RuleModule<"forbiddenVoidReturnArgument" | "forbiddenVoidReturnAttribute" | "forbiddenVoidReturnInheritedMethod" | "forbiddenVoidReturnProperty" | "forbiddenVoidReturnReturnValue" | "forbiddenVoidReturnVariable" | "forbiddenSpread", readonly {
|
|
136
|
+
checksVoidReturn?: boolean | ChecksVoidReturnOptions;
|
|
137
|
+
checksSpreads?: boolean;
|
|
138
|
+
}[], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
121
139
|
'no-nested-subscribe': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
122
140
|
'no-redundant-notify': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
123
141
|
'no-sharereplay': TSESLint.RuleModule<"forbidden" | "forbiddenWithoutConfig", readonly {
|
|
@@ -127,6 +145,7 @@ declare const rxjsX: {
|
|
|
127
145
|
'no-subject-unsubscribe': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
128
146
|
'no-subject-value': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
129
147
|
'no-subscribe-handlers': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
148
|
+
'no-subscribe-in-pipe': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
130
149
|
'no-tap': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
131
150
|
'no-topromise': TSESLint.RuleModule<"forbidden" | "suggestLastValueFrom" | "suggestFirstValueFrom", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|
|
132
151
|
'no-unbound-methods': TSESLint.RuleModule<"forbidden", [], RxjsXRuleDocs, TSESLint.RuleListener>;
|