eslint-plugin-rxjs-x 0.0.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/LICENSE +21 -0
- package/README.md +89 -0
- package/dist/index.cjs +2936 -0
- package/dist/index.d.cts +121 -0
- package/dist/index.d.mts +121 -0
- package/dist/index.d.ts +121 -0
- package/dist/index.mjs +2916 -0
- package/docs/rules/ban-observables.md +22 -0
- package/docs/rules/ban-operators.md +21 -0
- package/docs/rules/finnish.md +54 -0
- package/docs/rules/just.md +11 -0
- package/docs/rules/macro.md +7 -0
- package/docs/rules/no-async-subscribe.md +27 -0
- package/docs/rules/no-compat.md +11 -0
- package/docs/rules/no-connectable.md +7 -0
- package/docs/rules/no-create.md +29 -0
- package/docs/rules/no-cyclic-action.md +62 -0
- package/docs/rules/no-explicit-generics.md +23 -0
- package/docs/rules/no-exposed-subjects.md +39 -0
- package/docs/rules/no-finnish.md +25 -0
- package/docs/rules/no-ignored-error.md +37 -0
- package/docs/rules/no-ignored-notifier.md +30 -0
- package/docs/rules/no-ignored-observable.md +23 -0
- package/docs/rules/no-ignored-replay-buffer.md +28 -0
- package/docs/rules/no-ignored-subscribe.md +28 -0
- package/docs/rules/no-ignored-subscription.md +33 -0
- package/docs/rules/no-ignored-takewhile-value.md +26 -0
- package/docs/rules/no-implicit-any-catch.md +78 -0
- package/docs/rules/no-index.md +21 -0
- package/docs/rules/no-internal.md +21 -0
- package/docs/rules/no-nested-subscribe.md +30 -0
- package/docs/rules/no-redundant-notify.md +32 -0
- package/docs/rules/no-sharereplay.md +22 -0
- package/docs/rules/no-subclass.md +7 -0
- package/docs/rules/no-subject-unsubscribe.md +11 -0
- package/docs/rules/no-subject-value.md +7 -0
- package/docs/rules/no-subscribe-handlers.md +39 -0
- package/docs/rules/no-tap.md +7 -0
- package/docs/rules/no-topromise.md +7 -0
- package/docs/rules/no-unbound-methods.md +47 -0
- package/docs/rules/no-unsafe-catch.md +50 -0
- package/docs/rules/no-unsafe-first.md +16 -0
- package/docs/rules/no-unsafe-subject-next.md +30 -0
- package/docs/rules/no-unsafe-switchmap.md +38 -0
- package/docs/rules/no-unsafe-takeuntil.md +46 -0
- package/docs/rules/prefer-observer.md +34 -0
- package/docs/rules/suffix-subjects.md +42 -0
- package/docs/rules/throw-error.md +49 -0
- package/package.json +82 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 Nicholas Jamieson and contributors, 2024-PRESENT Jason Weinzierl <https://github.com/JasonWeinzierl>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# eslint-plugin-rxjs-x
|
|
2
|
+
|
|
3
|
+
This package contains a bunch of ESLint v9+ rules for RxJS.
|
|
4
|
+
It is a fork of [`eslint-plugin-rxjs`](https://github.com/cartant/eslint-plugin-rxjs)
|
|
5
|
+
initially started to support the new ESLint flat config format.
|
|
6
|
+
The original package is itself a re-implementation of the rules that are in the [`rxjs-tslint-rules`](https://github.com/cartant/rxjs-tslint-rules) package.
|
|
7
|
+
(The Angular-specific rules in `rxjs-tslint-rules` have been re-implemented in [`eslint-plugin-rxjs-angular`](https://github.com/cartant/eslint-plugin-rxjs-angular).)
|
|
8
|
+
|
|
9
|
+
Some of the rules are rather opinionated and are not included in the `recommended` configuration. Developers can decide for themselves whether they want to enable opinionated rules.
|
|
10
|
+
|
|
11
|
+
Almost all of these rules require the TypeScript parser for ESLint and are indicated as such below.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
See [typescript-eslint's Getting Started](https://typescript-eslint.io/getting-started) for a full ESLint setup guide.
|
|
16
|
+
|
|
17
|
+
Then use the `recommended` configuration in your `eslint.config.mjs`:
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
// @ts-check
|
|
21
|
+
import tseslint from 'typescript-eslint';
|
|
22
|
+
import rxjsX from 'eslint-plugin-rxjs-x';
|
|
23
|
+
|
|
24
|
+
export default tseslint.config({
|
|
25
|
+
extends: [
|
|
26
|
+
rxjsX.configs.recommended,
|
|
27
|
+
],
|
|
28
|
+
languageOptions: {
|
|
29
|
+
parserOptions: {
|
|
30
|
+
projectService: true,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Rules
|
|
37
|
+
|
|
38
|
+
The package includes the following rules.
|
|
39
|
+
|
|
40
|
+
πΌ Configurations enabled in.\
|
|
41
|
+
β
Set in the `recommended` configuration.\
|
|
42
|
+
π§ Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\
|
|
43
|
+
π‘ Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).\
|
|
44
|
+
π Requires [type information](https://typescript-eslint.io/linting/typed-linting).\
|
|
45
|
+
β Deprecated.
|
|
46
|
+
|
|
47
|
+
| NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β | Description | πΌ | π§ | π‘ | π | β |
|
|
48
|
+
| :--------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------- | :- | :- | :- | :- | :- |
|
|
49
|
+
| [ban-observables](docs/rules/ban-observables.md) | Forbids the use of banned observables. | | | | | |
|
|
50
|
+
| [ban-operators](docs/rules/ban-operators.md) | Forbids the use of banned operators. | | | | | |
|
|
51
|
+
| [finnish](docs/rules/finnish.md) | Enforces the use of Finnish notation. | | | | π | |
|
|
52
|
+
| [just](docs/rules/just.md) | Enforces the use of a `just` alias for `of`. | | π§ | | | |
|
|
53
|
+
| [macro](docs/rules/macro.md) | Enforces the use of the RxJS Tools Babel macro. | | π§ | | | |
|
|
54
|
+
| [no-async-subscribe](docs/rules/no-async-subscribe.md) | Forbids passing `async` functions to `subscribe`. | β
| | | π | |
|
|
55
|
+
| [no-compat](docs/rules/no-compat.md) | Forbids importation from locations that depend upon `rxjs-compat`. | | | | | |
|
|
56
|
+
| [no-connectable](docs/rules/no-connectable.md) | Forbids operators that return connectable observables. | | | | π | |
|
|
57
|
+
| [no-create](docs/rules/no-create.md) | Forbids the calling of `Observable.create`. | β
| | | π | |
|
|
58
|
+
| [no-cyclic-action](docs/rules/no-cyclic-action.md) | Forbids effects and epics that re-emit filtered actions. | | | | π | |
|
|
59
|
+
| [no-explicit-generics](docs/rules/no-explicit-generics.md) | Forbids explicit generic type arguments. | | | | | |
|
|
60
|
+
| [no-exposed-subjects](docs/rules/no-exposed-subjects.md) | Forbids exposed (i.e. non-private) subjects. | | | | π | |
|
|
61
|
+
| [no-finnish](docs/rules/no-finnish.md) | Forbids the use of Finnish notation. | | | | π | |
|
|
62
|
+
| [no-ignored-error](docs/rules/no-ignored-error.md) | Forbids the calling of `subscribe` without specifying an error handler. | | | | π | |
|
|
63
|
+
| [no-ignored-notifier](docs/rules/no-ignored-notifier.md) | Forbids observables not composed from the `repeatWhen` or `retryWhen` notifier. | β
| | | π | |
|
|
64
|
+
| [no-ignored-observable](docs/rules/no-ignored-observable.md) | Forbids the ignoring of observables returned by functions. | | | | π | |
|
|
65
|
+
| [no-ignored-replay-buffer](docs/rules/no-ignored-replay-buffer.md) | Forbids using `ReplaySubject`, `publishReplay` or `shareReplay` without specifying the buffer size. | β
| | | | |
|
|
66
|
+
| [no-ignored-subscribe](docs/rules/no-ignored-subscribe.md) | Forbids the calling of `subscribe` without specifying arguments. | | | | π | |
|
|
67
|
+
| [no-ignored-subscription](docs/rules/no-ignored-subscription.md) | Forbids ignoring the subscription returned by `subscribe`. | | | | π | |
|
|
68
|
+
| [no-ignored-takewhile-value](docs/rules/no-ignored-takewhile-value.md) | Forbids ignoring the value within `takeWhile`. | β
| | | | |
|
|
69
|
+
| [no-implicit-any-catch](docs/rules/no-implicit-any-catch.md) | Forbids implicit `any` error parameters in `catchError` operators. | β
| π§ | π‘ | π | |
|
|
70
|
+
| [no-index](docs/rules/no-index.md) | Forbids the importation from index modules. | β
| | | | |
|
|
71
|
+
| [no-internal](docs/rules/no-internal.md) | Forbids the importation of internals. | β
| π§ | π‘ | | |
|
|
72
|
+
| [no-nested-subscribe](docs/rules/no-nested-subscribe.md) | Forbids the calling of `subscribe` within a `subscribe` callback. | β
| | | π | |
|
|
73
|
+
| [no-redundant-notify](docs/rules/no-redundant-notify.md) | Forbids redundant notifications from completed or errored observables. | β
| | | π | |
|
|
74
|
+
| [no-sharereplay](docs/rules/no-sharereplay.md) | Forbids using the `shareReplay` operator. | β
| | | | |
|
|
75
|
+
| [no-subclass](docs/rules/no-subclass.md) | Forbids subclassing RxJS classes. | | | | π | |
|
|
76
|
+
| [no-subject-unsubscribe](docs/rules/no-subject-unsubscribe.md) | Forbids calling the `unsubscribe` method of a subject instance. | β
| | | π | |
|
|
77
|
+
| [no-subject-value](docs/rules/no-subject-value.md) | Forbids accessing the `value` property of a `BehaviorSubject` instance. | | | | π | |
|
|
78
|
+
| [no-subscribe-handlers](docs/rules/no-subscribe-handlers.md) | Forbids the passing of handlers to `subscribe`. | | | | π | |
|
|
79
|
+
| [no-tap](docs/rules/no-tap.md) | Forbids the use of the `tap` operator. | | | | | β |
|
|
80
|
+
| [no-topromise](docs/rules/no-topromise.md) | Forbids the use of the `toPromise` method. | | | | π | |
|
|
81
|
+
| [no-unbound-methods](docs/rules/no-unbound-methods.md) | Forbids the passing of unbound methods. | β
| | | π | |
|
|
82
|
+
| [no-unsafe-catch](docs/rules/no-unsafe-catch.md) | Forbids unsafe `catchError` usage in effects and epics. | | | | π | |
|
|
83
|
+
| [no-unsafe-first](docs/rules/no-unsafe-first.md) | Forbids unsafe `first`/`take` usage in effects and epics. | | | | π | |
|
|
84
|
+
| [no-unsafe-subject-next](docs/rules/no-unsafe-subject-next.md) | Forbids unsafe optional `next` calls. | β
| | | π | |
|
|
85
|
+
| [no-unsafe-switchmap](docs/rules/no-unsafe-switchmap.md) | Forbids unsafe `switchMap` usage in effects and epics. | | | | π | |
|
|
86
|
+
| [no-unsafe-takeuntil](docs/rules/no-unsafe-takeuntil.md) | Forbids the application of operators after `takeUntil`. | β
| | | π | |
|
|
87
|
+
| [prefer-observer](docs/rules/prefer-observer.md) | Forbids the passing separate handlers to `subscribe` and `tap`. | | π§ | π‘ | π | |
|
|
88
|
+
| [suffix-subjects](docs/rules/suffix-subjects.md) | Enforces the use of a suffix in subject identifiers. | | | | π | |
|
|
89
|
+
| [throw-error](docs/rules/throw-error.md) | Enforces the passing of `Error` values to error notifications. | | | | π | |
|