eslint-plugin-rxjs-x 0.9.4 β†’ 1.0.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 CHANGED
@@ -4,7 +4,11 @@
4
4
  [![NPM version](https://img.shields.io/npm/v/eslint-plugin-rxjs-x.svg)](https://www.npmjs.com/package/eslint-plugin-rxjs-x)
5
5
  [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/JasonWeinzierl/eslint-plugin-rxjs-x/badge)](https://scorecard.dev/viewer/?uri=github.com/JasonWeinzierl/eslint-plugin-rxjs-x)
6
6
 
7
- This ESLint plugin is intended to prevent issues with [RxJS](https://github.com/ReactiveX/rxjs).
7
+ > [!NOTE]
8
+ > Forked from [`eslint-plugin-rxjs`](https://github.com/cartant/eslint-plugin-rxjs)
9
+ > as the original repository seems [no longer maintained](https://github.com/cartant/eslint-plugin-rxjs/issues/127).
10
+
11
+ This ESLint plugin is intended to prevent issues with [RxJS 7](https://github.com/ReactiveX/rxjs/tree/7.x).
8
12
 
9
13
  Most of these rules require TypeScript typed linting and are indicated as such below.
10
14
 
@@ -39,60 +43,17 @@ See [typescript-eslint's Getting Started](https://typescript-eslint.io/getting-s
39
43
 
40
44
  Additionally, consider if the `rxjsX.configs.strict` shared config is right for your project.
41
45
 
42
- ## Legacy Migration Guide from `eslint-plugin-rxjs`
46
+ ## Notable Changes from `eslint-plugin-rxjs`
47
+
48
+ 1. eslintrc is not supported.
49
+ 2. The namespace of this plugin is `rxjs-x` instead of `rxjs`.
50
+ - e.g. if your ESLint config had `"rxjs/no-subject-value": "error"`, replace it with `"rxjs-x/no-subject-value": "error"`.
51
+ - e.g. if your project had inline comments like `// eslint-disable-next-line rxjs/no-async-subscribe`, replace them with `// eslint-disable-next-line rxjs-x/no-async-subscribe`.
52
+ 3. `rxjs/no-ignored-observable` is replaced with `rxjs-x/no-floating-observable`.
43
53
 
44
54
  > [!TIP]
45
55
  > A complete description of all changes from `eslint-plugin-rxjs` are documented in the [CHANGELOG](CHANGELOG.md) file.
46
56
 
47
- This project started as a fork of [`eslint-plugin-rxjs`](https://github.com/cartant/eslint-plugin-rxjs)
48
- but is still compatible with the eslintrc configuration format.
49
-
50
- > [!WARNING]
51
- > eslintrc compatibility will be removed in v1.
52
- > Users are highly encouraged to upgrade to ESLint's flat configuration format.
53
- > See: [https://eslint.org/docs/latest/use/configure/migration-guide]
54
-
55
- 1. Install `eslint-plugin-rxjs-x` using your preferred package manager.
56
- 2. If you previously used the `plugin:rxjs/recommended` shared config,
57
- replace it with `plugin:rxjs-x/recommended-legacy`:
58
-
59
- ```diff
60
- "extends": [
61
- "plugin:@typescript-eslint/recommended",
62
- - "plugin:rxjs/recommended",
63
- + "plugin:rxjs-x/recommended-legacy",
64
- ],
65
- ```
66
-
67
- 3. If you previously did _not_ use a shared config,
68
- then replace the `rxjs` plugin to your `plugins` block:
69
-
70
- ```diff
71
- "plugins": [
72
- "@typescript-eslint",
73
- - "rxjs",
74
- + "rxjs-x",
75
- ],
76
- ```
77
-
78
- - Note: this is unnecessary if you are using the `recommended-legacy` shared config.
79
- 4. In your `rules` blocks, replace the namespace `rxjs` with `rxjs-x` for all rules:
80
-
81
- ```diff
82
- "rules": {
83
- - "rxjs/no-subject-value": "error",
84
- + "rxjs-x/no-subject-value": "error",
85
- },
86
- ```
87
-
88
- - Note: if your project has inline comments (e.g. `eslint-disable-next-line`) referencing `rxjs` rules, you must update the namespace there too.
89
- 5. If you previously used `rxjs/no-ignored-observable`, consider replacing it with `rxjs-x/no-floating-observables`. `no-ignored-observable` will be removed in v1.
90
-
91
- ```diff
92
- - 'rxjs/no-ignored-observable': 'error',
93
- + 'rxjs-x/no-floating-observables': 'error',
94
- ```
95
-
96
57
  ## Configs
97
58
 
98
59
  <!-- begin auto-generated configs list -->
@@ -115,58 +76,53 @@ The package includes the following rules.
115
76
  πŸ”’ Set in the `strict` configuration.\
116
77
  πŸ”§ Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\
117
78
  πŸ’‘ Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).\
118
- πŸ’­ Requires [type information](https://typescript-eslint.io/linting/typed-linting).\
119
- ❌ Deprecated.
120
-
121
- | NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | πŸ”§ | πŸ’‘ | πŸ’­ | ❌ |
122
- | :------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------- | :--- | :- | :- | :- | :- |
123
- | [ban-observables](docs/rules/ban-observables.md) | Disallow banned observable creators. | | | | | |
124
- | [ban-operators](docs/rules/ban-operators.md) | Disallow banned operators. | | | | πŸ’­ | |
125
- | [finnish](docs/rules/finnish.md) | Enforce Finnish notation. | | | | πŸ’­ | |
126
- | [just](docs/rules/just.md) | Require the use of `just` instead of `of`. | | πŸ”§ | | | |
127
- | [macro](docs/rules/macro.md) | Require the use of the RxJS Tools Babel macro. | | πŸ”§ | | | ❌ |
128
- | [no-async-subscribe](docs/rules/no-async-subscribe.md) | Disallow passing `async` functions to `subscribe`. | βœ… πŸ”’ | | | πŸ’­ | |
129
- | [no-compat](docs/rules/no-compat.md) | Disallow the `rxjs-compat` package. | | | | | ❌ |
130
- | [no-connectable](docs/rules/no-connectable.md) | Disallow operators that return connectable observables. | | | | πŸ’­ | |
131
- | [no-create](docs/rules/no-create.md) | Disallow the static `Observable.create` and `Subject.create` functions. | βœ… πŸ”’ | | | πŸ’­ | |
132
- | [no-cyclic-action](docs/rules/no-cyclic-action.md) | Disallow cyclic actions in effects and epics. | | | | πŸ’­ | |
133
- | [no-explicit-generics](docs/rules/no-explicit-generics.md) | Disallow unnecessary explicit generic type arguments. | | | | πŸ’­ | |
134
- | [no-exposed-subjects](docs/rules/no-exposed-subjects.md) | Disallow public and protected subjects. | πŸ”’ | | | πŸ’­ | |
135
- | [no-finnish](docs/rules/no-finnish.md) | Disallow Finnish notation. | | | | πŸ’­ | |
136
- | [no-floating-observables](docs/rules/no-floating-observables.md) | Require Observables to be handled appropriately. | πŸ”’ | | | πŸ’­ | |
137
- | [no-ignored-default-value](docs/rules/no-ignored-default-value.md) | Disallow using `firstValueFrom`, `lastValueFrom`, `first`, and `last` without specifying a default value. | πŸ”’ | | | πŸ’­ | |
138
- | [no-ignored-error](docs/rules/no-ignored-error.md) | Disallow calling `subscribe` without specifying an error handler. | πŸ”’ | | | πŸ’­ | |
139
- | [no-ignored-notifier](docs/rules/no-ignored-notifier.md) | Disallow observables not composed from the `repeatWhen` or `retryWhen` notifier. | βœ… πŸ”’ | | | πŸ’­ | |
140
- | [no-ignored-observable](docs/rules/no-ignored-observable.md) | Disallow ignoring of observables returned by functions. | | | | | ❌ |
141
- | [no-ignored-replay-buffer](docs/rules/no-ignored-replay-buffer.md) | Disallow using `ReplaySubject`, `publishReplay` or `shareReplay` without specifying the buffer size. | βœ… πŸ”’ | | | | |
142
- | [no-ignored-subscribe](docs/rules/no-ignored-subscribe.md) | Disallow calling `subscribe` without specifying arguments. | | | | πŸ’­ | |
143
- | [no-ignored-subscription](docs/rules/no-ignored-subscription.md) | Disallow ignoring the subscription returned by `subscribe`. | | | | πŸ’­ | |
144
- | [no-ignored-takewhile-value](docs/rules/no-ignored-takewhile-value.md) | Disallow ignoring the value within `takeWhile`. | βœ… πŸ”’ | | | | |
145
- | [no-implicit-any-catch](docs/rules/no-implicit-any-catch.md) | Disallow implicit `any` error parameters in `catchError`, `subscribe`, and `tap`. | βœ… πŸ”’ | πŸ”§ | πŸ’‘ | πŸ’­ | |
146
- | [no-index](docs/rules/no-index.md) | Disallow importing index modules. | βœ… πŸ”’ | | | | |
147
- | [no-internal](docs/rules/no-internal.md) | Disallow importing internal modules. | βœ… πŸ”’ | πŸ”§ | πŸ’‘ | | |
148
- | [no-misused-observables](docs/rules/no-misused-observables.md) | Disallow Observables in places not designed to handle them. | πŸ”’ | | | πŸ’­ | |
149
- | [no-nested-subscribe](docs/rules/no-nested-subscribe.md) | Disallow calling `subscribe` within a `subscribe` callback. | βœ… πŸ”’ | | | πŸ’­ | |
150
- | [no-redundant-notify](docs/rules/no-redundant-notify.md) | Disallow sending redundant notifications from completed or errored observables. | βœ… πŸ”’ | | | πŸ’­ | |
151
- | [no-sharereplay](docs/rules/no-sharereplay.md) | Disallow unsafe `shareReplay` usage. | βœ… πŸ”’ | | | | |
152
- | [no-sharereplay-before-takeuntil](docs/rules/no-sharereplay-before-takeuntil.md) | Disallow using `shareReplay({ refCount: false })` before `takeUntil`. | πŸ”’ | | | | |
153
- | [no-subclass](docs/rules/no-subclass.md) | Disallow subclassing RxJS classes. | πŸ”’ | | | πŸ’­ | |
154
- | [no-subject-unsubscribe](docs/rules/no-subject-unsubscribe.md) | Disallow calling the `unsubscribe` method of subjects. | βœ… πŸ”’ | | | πŸ’­ | |
155
- | [no-subject-value](docs/rules/no-subject-value.md) | Disallow accessing the `value` property of a `BehaviorSubject` instance. | | | | πŸ’­ | |
156
- | [no-subscribe-handlers](docs/rules/no-subscribe-handlers.md) | Disallow passing handlers to `subscribe`. | | | | πŸ’­ | |
157
- | [no-subscribe-in-pipe](docs/rules/no-subscribe-in-pipe.md) | Disallow calling of `subscribe` within any RxJS operator inside a `pipe`. | βœ… πŸ”’ | | | πŸ’­ | |
158
- | [no-tap](docs/rules/no-tap.md) | Disallow the `tap` operator. | | | | | ❌ |
159
- | [no-topromise](docs/rules/no-topromise.md) | Disallow use of the `toPromise` method. | βœ… πŸ”’ | | πŸ’‘ | πŸ’­ | |
160
- | [no-unbound-methods](docs/rules/no-unbound-methods.md) | Disallow passing unbound methods. | βœ… πŸ”’ | | | πŸ’­ | |
161
- | [no-unnecessary-collection](docs/rules/no-unnecessary-collection.md) | Disallow unnecessary usage of collection arguments with single values. | πŸ”’ | | | | |
162
- | [no-unsafe-catch](docs/rules/no-unsafe-catch.md) | Disallow unsafe `catchError` usage in effects and epics. | | | | πŸ’­ | |
163
- | [no-unsafe-first](docs/rules/no-unsafe-first.md) | Disallow unsafe `first`/`take` usage in effects and epics. | | | | πŸ’­ | |
164
- | [no-unsafe-subject-next](docs/rules/no-unsafe-subject-next.md) | Disallow unsafe optional `next` calls. | βœ… πŸ”’ | | | πŸ’­ | |
165
- | [no-unsafe-switchmap](docs/rules/no-unsafe-switchmap.md) | Disallow unsafe `switchMap` usage in effects and epics. | | | | πŸ’­ | |
166
- | [no-unsafe-takeuntil](docs/rules/no-unsafe-takeuntil.md) | Disallow applying operators after `takeUntil`. | βœ… πŸ”’ | | | πŸ’­ | |
167
- | [prefer-observer](docs/rules/prefer-observer.md) | Disallow passing separate handlers to `subscribe` and `tap`. | βœ… πŸ”’ | πŸ”§ | πŸ’‘ | πŸ’­ | |
168
- | [prefer-root-operators](docs/rules/prefer-root-operators.md) | Disallow importing operators from `rxjs/operators`. | βœ… πŸ”’ | πŸ”§ | πŸ’‘ | | |
169
- | [suffix-subjects](docs/rules/suffix-subjects.md) | Enforce the use of a suffix in subject identifiers. | | | | πŸ’­ | |
170
- | [throw-error](docs/rules/throw-error.md) | Enforce passing only `Error` values to `throwError` or `Subject.error`. | βœ… πŸ”’ | | πŸ’‘ | πŸ’­ | |
79
+ πŸ’­ Requires [type information](https://typescript-eslint.io/linting/typed-linting).
80
+
81
+ | NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | πŸ”§ | πŸ’‘ | πŸ’­ |
82
+ | :------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------- | :--- | :- | :- | :- |
83
+ | [ban-observables](docs/rules/ban-observables.md) | Disallow banned observable creators. | | | | |
84
+ | [ban-operators](docs/rules/ban-operators.md) | Disallow banned operators. | | | | πŸ’­ |
85
+ | [finnish](docs/rules/finnish.md) | Enforce Finnish notation. | | | | πŸ’­ |
86
+ | [just](docs/rules/just.md) | Require the use of `just` instead of `of`. | | πŸ”§ | | |
87
+ | [no-async-subscribe](docs/rules/no-async-subscribe.md) | Disallow passing `async` functions to `subscribe`. | βœ… πŸ”’ | | | πŸ’­ |
88
+ | [no-connectable](docs/rules/no-connectable.md) | Disallow operators that return connectable observables. | | | | πŸ’­ |
89
+ | [no-create](docs/rules/no-create.md) | Disallow the static `Observable.create` and `Subject.create` functions. | βœ… πŸ”’ | | | πŸ’­ |
90
+ | [no-cyclic-action](docs/rules/no-cyclic-action.md) | Disallow cyclic actions in effects and epics. | | | | πŸ’­ |
91
+ | [no-explicit-generics](docs/rules/no-explicit-generics.md) | Disallow unnecessary explicit generic type arguments. | | | | πŸ’­ |
92
+ | [no-exposed-subjects](docs/rules/no-exposed-subjects.md) | Disallow public and protected subjects. | πŸ”’ | | | πŸ’­ |
93
+ | [no-finnish](docs/rules/no-finnish.md) | Disallow Finnish notation. | | | | πŸ’­ |
94
+ | [no-floating-observables](docs/rules/no-floating-observables.md) | Require Observables to be handled appropriately. | πŸ”’ | | | πŸ’­ |
95
+ | [no-ignored-default-value](docs/rules/no-ignored-default-value.md) | Disallow using `firstValueFrom`, `lastValueFrom`, `first`, and `last` without specifying a default value. | πŸ”’ | | | πŸ’­ |
96
+ | [no-ignored-error](docs/rules/no-ignored-error.md) | Disallow calling `subscribe` without specifying an error handler. | πŸ”’ | | | πŸ’­ |
97
+ | [no-ignored-notifier](docs/rules/no-ignored-notifier.md) | Disallow observables not composed from the `repeatWhen` or `retryWhen` notifier. | βœ… πŸ”’ | | | πŸ’­ |
98
+ | [no-ignored-replay-buffer](docs/rules/no-ignored-replay-buffer.md) | Disallow using `ReplaySubject`, `publishReplay` or `shareReplay` without specifying the buffer size. | βœ… πŸ”’ | | | |
99
+ | [no-ignored-subscribe](docs/rules/no-ignored-subscribe.md) | Disallow calling `subscribe` without specifying arguments. | | | | πŸ’­ |
100
+ | [no-ignored-subscription](docs/rules/no-ignored-subscription.md) | Disallow ignoring the subscription returned by `subscribe`. | | | | πŸ’­ |
101
+ | [no-ignored-takewhile-value](docs/rules/no-ignored-takewhile-value.md) | Disallow ignoring the value within `takeWhile`. | βœ… πŸ”’ | | | |
102
+ | [no-implicit-any-catch](docs/rules/no-implicit-any-catch.md) | Disallow implicit `any` error parameters in `catchError`, `subscribe`, and `tap`. | βœ… πŸ”’ | πŸ”§ | πŸ’‘ | πŸ’­ |
103
+ | [no-index](docs/rules/no-index.md) | Disallow importing index modules. | βœ… πŸ”’ | | | |
104
+ | [no-internal](docs/rules/no-internal.md) | Disallow importing internal modules. | βœ… πŸ”’ | πŸ”§ | πŸ’‘ | |
105
+ | [no-misused-observables](docs/rules/no-misused-observables.md) | Disallow Observables in places not designed to handle them. | πŸ”’ | | | πŸ’­ |
106
+ | [no-nested-subscribe](docs/rules/no-nested-subscribe.md) | Disallow calling `subscribe` within a `subscribe` callback. | βœ… πŸ”’ | | | πŸ’­ |
107
+ | [no-redundant-notify](docs/rules/no-redundant-notify.md) | Disallow sending redundant notifications from completed or errored observables. | βœ… πŸ”’ | | | πŸ’­ |
108
+ | [no-sharereplay](docs/rules/no-sharereplay.md) | Disallow unsafe `shareReplay` usage. | βœ… πŸ”’ | | | |
109
+ | [no-sharereplay-before-takeuntil](docs/rules/no-sharereplay-before-takeuntil.md) | Disallow using `shareReplay({ refCount: false })` before `takeUntil`. | πŸ”’ | | | |
110
+ | [no-subclass](docs/rules/no-subclass.md) | Disallow subclassing RxJS classes. | πŸ”’ | | | πŸ’­ |
111
+ | [no-subject-unsubscribe](docs/rules/no-subject-unsubscribe.md) | Disallow calling the `unsubscribe` method of subjects. | βœ… πŸ”’ | | | πŸ’­ |
112
+ | [no-subject-value](docs/rules/no-subject-value.md) | Disallow accessing the `value` property of a `BehaviorSubject` instance. | | | | πŸ’­ |
113
+ | [no-subscribe-handlers](docs/rules/no-subscribe-handlers.md) | Disallow passing handlers to `subscribe`. | | | | πŸ’­ |
114
+ | [no-subscribe-in-pipe](docs/rules/no-subscribe-in-pipe.md) | Disallow calling of `subscribe` within any RxJS operator inside a `pipe`. | βœ… πŸ”’ | | | πŸ’­ |
115
+ | [no-topromise](docs/rules/no-topromise.md) | Disallow use of the `toPromise` method. | βœ… πŸ”’ | | πŸ’‘ | πŸ’­ |
116
+ | [no-unbound-methods](docs/rules/no-unbound-methods.md) | Disallow passing unbound methods. | βœ… πŸ”’ | | | πŸ’­ |
117
+ | [no-unnecessary-collection](docs/rules/no-unnecessary-collection.md) | Disallow unnecessary usage of collection arguments with single values. | πŸ”’ | | | |
118
+ | [no-unsafe-catch](docs/rules/no-unsafe-catch.md) | Disallow unsafe `catchError` usage in effects and epics. | | | | πŸ’­ |
119
+ | [no-unsafe-first](docs/rules/no-unsafe-first.md) | Disallow unsafe `first`/`take` usage in effects and epics. | | | | πŸ’­ |
120
+ | [no-unsafe-subject-next](docs/rules/no-unsafe-subject-next.md) | Disallow unsafe optional `next` calls. | βœ… πŸ”’ | | | πŸ’­ |
121
+ | [no-unsafe-switchmap](docs/rules/no-unsafe-switchmap.md) | Disallow unsafe `switchMap` usage in effects and epics. | | | | πŸ’­ |
122
+ | [no-unsafe-takeuntil](docs/rules/no-unsafe-takeuntil.md) | Disallow applying operators after `takeUntil`. | βœ… πŸ”’ | | | πŸ’­ |
123
+ | [prefer-observer](docs/rules/prefer-observer.md) | Disallow passing separate handlers to `subscribe` and `tap`. | βœ… πŸ”’ | πŸ”§ | πŸ’‘ | πŸ’­ |
124
+ | [prefer-root-operators](docs/rules/prefer-root-operators.md) | Disallow importing operators from `rxjs/operators`. | βœ… πŸ”’ | πŸ”§ | πŸ’‘ | |
125
+ | [suffix-subjects](docs/rules/suffix-subjects.md) | Enforce the use of a suffix in subject identifiers. | | | | πŸ’­ |
126
+ | [throw-error](docs/rules/throw-error.md) | Enforce passing only `Error` values to `throwError` or `Subject.error`. | βœ… πŸ”’ | | πŸ’‘ | πŸ’­ |
171
127
 
172
128
  <!-- end auto-generated rules list -->