eslint-plugin-rxjs-x 0.3.2 β†’ 0.4.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
@@ -3,15 +3,22 @@
3
3
  [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/JasonWeinzierl/eslint-plugin-rxjs-x/blob/master/LICENSE)
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
 
6
- This package contains a bunch of ESLint v9+ rules for RxJS.
7
- It is a fork of [`eslint-plugin-rxjs`](https://github.com/cartant/eslint-plugin-rxjs)
6
+ This ESLint plugin is intended to prevent issues with [RxJS](https://github.com/ReactiveX/rxjs).
7
+
8
+ Most of these rules require TypeScript typed linting and are indicated as such below.
9
+
10
+ ## Migrating from `eslint-plugin-rxjs`
11
+
12
+ This project is a fork of [`eslint-plugin-rxjs`](https://github.com/cartant/eslint-plugin-rxjs)
8
13
  initially started to support the new ESLint flat config format.
9
- 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.
10
- (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).)
14
+ There are some breaking changes:
11
15
 
12
- 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.
16
+ - The old `.eslintrc` format is not supported.
17
+ - If you need to continue using this old format, use the original `eslint-plugin-rxjs` or a different fork.
18
+ - The plugin namespace specified in the `recommended` config was changed from `rxjs` to `rxjs-x`.
19
+ - e.g. In your ESLint config, `rxjs/no-subject-value` should be renamed to `rxjs-x/no-subject-value`.
13
20
 
14
- Almost all of these rules require the TypeScript parser for ESLint and are indicated as such below.
21
+ A complete description of all changes are documented in the [CHANGELOG](CHANGELOG.md) file.
15
22
 
16
23
  ## Install
17
24
 
@@ -48,6 +55,7 @@ See [Linting with Type Information](https://typescript-eslint.io/getting-started
48
55
  | | Name |
49
56
  | :- | :------------ |
50
57
  | βœ… | `recommended` |
58
+ | πŸ”’ | `strict` |
51
59
 
52
60
  <!-- end auto-generated configs list -->
53
61
 
@@ -59,55 +67,56 @@ The package includes the following rules.
59
67
 
60
68
  πŸ’Ό Configurations enabled in.\
61
69
  βœ… Set in the `recommended` configuration.\
70
+ πŸ”’ Set in the `strict` configuration.\
62
71
  πŸ”§ Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\
63
72
  πŸ’‘ Manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).\
64
73
  πŸ’­ Requires [type information](https://typescript-eslint.io/linting/typed-linting).\
65
74
  ❌ Deprecated.
66
75
 
67
- | NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | πŸ”§ | πŸ’‘ | πŸ’­ | ❌ |
68
- | :--------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------- | :- | :- | :- | :- | :- |
69
- | [ban-observables](docs/rules/ban-observables.md) | Disallow banned observable creators. | | | | | |
70
- | [ban-operators](docs/rules/ban-operators.md) | Disallow banned operators. | | | | πŸ’­ | |
71
- | [finnish](docs/rules/finnish.md) | Enforce Finnish notation. | | | | πŸ’­ | |
72
- | [just](docs/rules/just.md) | Require the use of `just` instead of `of`. | | πŸ”§ | | | |
73
- | [macro](docs/rules/macro.md) | Require the use of the RxJS Tools Babel macro. | | πŸ”§ | | | ❌ |
74
- | [no-async-subscribe](docs/rules/no-async-subscribe.md) | Disallow passing `async` functions to `subscribe`. | βœ… | | | πŸ’­ | |
75
- | [no-compat](docs/rules/no-compat.md) | Disallow the `rxjs-compat` package. | | | | | ❌ |
76
- | [no-connectable](docs/rules/no-connectable.md) | Disallow operators that return connectable observables. | | | | πŸ’­ | |
77
- | [no-create](docs/rules/no-create.md) | Disallow the static `Observable.create` function. | βœ… | | | πŸ’­ | |
78
- | [no-cyclic-action](docs/rules/no-cyclic-action.md) | Disallow cyclic actions in effects and epics. | | | | πŸ’­ | |
79
- | [no-explicit-generics](docs/rules/no-explicit-generics.md) | Disallow unnecessary explicit generic type arguments. | | | | | |
80
- | [no-exposed-subjects](docs/rules/no-exposed-subjects.md) | Disallow public and protected subjects. | | | | πŸ’­ | |
81
- | [no-finnish](docs/rules/no-finnish.md) | Disallow Finnish notation. | | | | πŸ’­ | |
82
- | [no-ignored-default-value](docs/rules/no-ignored-default-value.md) | Disallow using `firstValueFrom`, `lastValueFrom`, `first`, and `last` without specifying a default value. | | | | πŸ’­ | |
83
- | [no-ignored-error](docs/rules/no-ignored-error.md) | Disallow calling `subscribe` without specifying an error handler. | | | | πŸ’­ | |
84
- | [no-ignored-notifier](docs/rules/no-ignored-notifier.md) | Disallow observables not composed from the `repeatWhen` or `retryWhen` notifier. | βœ… | | | πŸ’­ | |
85
- | [no-ignored-observable](docs/rules/no-ignored-observable.md) | Disallow ignoring observables returned by functions. | | | | πŸ’­ | |
86
- | [no-ignored-replay-buffer](docs/rules/no-ignored-replay-buffer.md) | Disallow using `ReplaySubject`, `publishReplay` or `shareReplay` without specifying the buffer size. | βœ… | | | | |
87
- | [no-ignored-subscribe](docs/rules/no-ignored-subscribe.md) | Disallow calling `subscribe` without specifying arguments. | | | | πŸ’­ | |
88
- | [no-ignored-subscription](docs/rules/no-ignored-subscription.md) | Disallow ignoring the subscription returned by `subscribe`. | | | | πŸ’­ | |
89
- | [no-ignored-takewhile-value](docs/rules/no-ignored-takewhile-value.md) | Disallow ignoring the value within `takeWhile`. | βœ… | | | | |
90
- | [no-implicit-any-catch](docs/rules/no-implicit-any-catch.md) | Disallow implicit `any` error parameters in `catchError` operators. | βœ… | πŸ”§ | πŸ’‘ | πŸ’­ | |
91
- | [no-index](docs/rules/no-index.md) | Disallow importing index modules. | βœ… | | | | |
92
- | [no-internal](docs/rules/no-internal.md) | Disallow importing internal modules. | βœ… | πŸ”§ | πŸ’‘ | | |
93
- | [no-nested-subscribe](docs/rules/no-nested-subscribe.md) | Disallow calling `subscribe` within a `subscribe` callback. | βœ… | | | πŸ’­ | |
94
- | [no-redundant-notify](docs/rules/no-redundant-notify.md) | Disallow sending redundant notifications from completed or errored observables. | βœ… | | | πŸ’­ | |
95
- | [no-sharereplay](docs/rules/no-sharereplay.md) | Disallow unsafe `shareReplay` usage. | βœ… | | | | |
96
- | [no-subclass](docs/rules/no-subclass.md) | Disallow subclassing RxJS classes. | | | | πŸ’­ | |
97
- | [no-subject-unsubscribe](docs/rules/no-subject-unsubscribe.md) | Disallow calling the `unsubscribe` method of subjects. | βœ… | | | πŸ’­ | |
98
- | [no-subject-value](docs/rules/no-subject-value.md) | Disallow accessing the `value` property of a `BehaviorSubject` instance. | | | | πŸ’­ | |
99
- | [no-subscribe-handlers](docs/rules/no-subscribe-handlers.md) | Disallow passing handlers to `subscribe`. | | | | πŸ’­ | |
100
- | [no-tap](docs/rules/no-tap.md) | Disallow the `tap` operator. | | | | | ❌ |
101
- | [no-topromise](docs/rules/no-topromise.md) | Disallow use of the `toPromise` method. | | | πŸ’‘ | πŸ’­ | |
102
- | [no-unbound-methods](docs/rules/no-unbound-methods.md) | Disallow passing unbound methods. | βœ… | | | πŸ’­ | |
103
- | [no-unsafe-catch](docs/rules/no-unsafe-catch.md) | Disallow unsafe `catchError` usage in effects and epics. | | | | πŸ’­ | |
104
- | [no-unsafe-first](docs/rules/no-unsafe-first.md) | Disallow unsafe `first`/`take` usage in effects and epics. | | | | πŸ’­ | |
105
- | [no-unsafe-subject-next](docs/rules/no-unsafe-subject-next.md) | Disallow unsafe optional `next` calls. | βœ… | | | πŸ’­ | |
106
- | [no-unsafe-switchmap](docs/rules/no-unsafe-switchmap.md) | Disallow unsafe `switchMap` usage in effects and epics. | | | | πŸ’­ | |
107
- | [no-unsafe-takeuntil](docs/rules/no-unsafe-takeuntil.md) | Disallow applying operators after `takeUntil`. | βœ… | | | πŸ’­ | |
108
- | [prefer-observer](docs/rules/prefer-observer.md) | Disallow passing separate handlers to `subscribe` and `tap`. | | πŸ”§ | πŸ’‘ | πŸ’­ | |
109
- | [prefer-root-operators](docs/rules/prefer-root-operators.md) | Disallow importing operators from `rxjs/operators`. | | πŸ”§ | πŸ’‘ | | |
110
- | [suffix-subjects](docs/rules/suffix-subjects.md) | Enforce the use of a suffix in subject identifiers. | | | | πŸ’­ | |
111
- | [throw-error](docs/rules/throw-error.md) | Enforce passing only `Error` values to `throwError`. | | | | πŸ’­ | |
76
+ | NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | πŸ”§ | πŸ’‘ | πŸ’­ | ❌ |
77
+ | :--------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------- | :--- | :- | :- | :- | :- |
78
+ | [ban-observables](docs/rules/ban-observables.md) | Disallow banned observable creators. | | | | | |
79
+ | [ban-operators](docs/rules/ban-operators.md) | Disallow banned operators. | | | | πŸ’­ | |
80
+ | [finnish](docs/rules/finnish.md) | Enforce Finnish notation. | | | | πŸ’­ | |
81
+ | [just](docs/rules/just.md) | Require the use of `just` instead of `of`. | | πŸ”§ | | | |
82
+ | [macro](docs/rules/macro.md) | Require the use of the RxJS Tools Babel macro. | | πŸ”§ | | | ❌ |
83
+ | [no-async-subscribe](docs/rules/no-async-subscribe.md) | Disallow passing `async` functions to `subscribe`. | βœ… πŸ”’ | | | πŸ’­ | |
84
+ | [no-compat](docs/rules/no-compat.md) | Disallow the `rxjs-compat` package. | | | | | ❌ |
85
+ | [no-connectable](docs/rules/no-connectable.md) | Disallow operators that return connectable observables. | | | | πŸ’­ | |
86
+ | [no-create](docs/rules/no-create.md) | Disallow the static `Observable.create` function. | βœ… πŸ”’ | | | πŸ’­ | |
87
+ | [no-cyclic-action](docs/rules/no-cyclic-action.md) | Disallow cyclic actions in effects and epics. | | | | πŸ’­ | |
88
+ | [no-explicit-generics](docs/rules/no-explicit-generics.md) | Disallow unnecessary explicit generic type arguments. | πŸ”’ | | | | |
89
+ | [no-exposed-subjects](docs/rules/no-exposed-subjects.md) | Disallow public and protected subjects. | πŸ”’ | | | πŸ’­ | |
90
+ | [no-finnish](docs/rules/no-finnish.md) | Disallow Finnish notation. | | | | πŸ’­ | |
91
+ | [no-ignored-default-value](docs/rules/no-ignored-default-value.md) | Disallow using `firstValueFrom`, `lastValueFrom`, `first`, and `last` without specifying a default value. | πŸ”’ | | | πŸ’­ | |
92
+ | [no-ignored-error](docs/rules/no-ignored-error.md) | Disallow calling `subscribe` without specifying an error handler. | πŸ”’ | | | πŸ’­ | |
93
+ | [no-ignored-notifier](docs/rules/no-ignored-notifier.md) | Disallow observables not composed from the `repeatWhen` or `retryWhen` notifier. | βœ… πŸ”’ | | | πŸ’­ | |
94
+ | [no-ignored-observable](docs/rules/no-ignored-observable.md) | Disallow ignoring observables returned by functions. | πŸ”’ | | | πŸ’­ | |
95
+ | [no-ignored-replay-buffer](docs/rules/no-ignored-replay-buffer.md) | Disallow using `ReplaySubject`, `publishReplay` or `shareReplay` without specifying the buffer size. | βœ… πŸ”’ | | | | |
96
+ | [no-ignored-subscribe](docs/rules/no-ignored-subscribe.md) | Disallow calling `subscribe` without specifying arguments. | | | | πŸ’­ | |
97
+ | [no-ignored-subscription](docs/rules/no-ignored-subscription.md) | Disallow ignoring the subscription returned by `subscribe`. | | | | πŸ’­ | |
98
+ | [no-ignored-takewhile-value](docs/rules/no-ignored-takewhile-value.md) | Disallow ignoring the value within `takeWhile`. | βœ… πŸ”’ | | | | |
99
+ | [no-implicit-any-catch](docs/rules/no-implicit-any-catch.md) | Disallow implicit `any` error parameters in `catchError` operators. | βœ… πŸ”’ | πŸ”§ | πŸ’‘ | πŸ’­ | |
100
+ | [no-index](docs/rules/no-index.md) | Disallow importing index modules. | βœ… πŸ”’ | | | | |
101
+ | [no-internal](docs/rules/no-internal.md) | Disallow importing internal modules. | βœ… πŸ”’ | πŸ”§ | πŸ’‘ | | |
102
+ | [no-nested-subscribe](docs/rules/no-nested-subscribe.md) | Disallow calling `subscribe` within a `subscribe` callback. | βœ… πŸ”’ | | | πŸ’­ | |
103
+ | [no-redundant-notify](docs/rules/no-redundant-notify.md) | Disallow sending redundant notifications from completed or errored observables. | βœ… πŸ”’ | | | πŸ’­ | |
104
+ | [no-sharereplay](docs/rules/no-sharereplay.md) | Disallow unsafe `shareReplay` usage. | βœ… πŸ”’ | | | | |
105
+ | [no-subclass](docs/rules/no-subclass.md) | Disallow subclassing RxJS classes. | πŸ”’ | | | πŸ’­ | |
106
+ | [no-subject-unsubscribe](docs/rules/no-subject-unsubscribe.md) | Disallow calling the `unsubscribe` method of subjects. | βœ… πŸ”’ | | | πŸ’­ | |
107
+ | [no-subject-value](docs/rules/no-subject-value.md) | Disallow accessing the `value` property of a `BehaviorSubject` instance. | | | | πŸ’­ | |
108
+ | [no-subscribe-handlers](docs/rules/no-subscribe-handlers.md) | Disallow passing handlers to `subscribe`. | | | | πŸ’­ | |
109
+ | [no-tap](docs/rules/no-tap.md) | Disallow the `tap` operator. | | | | | ❌ |
110
+ | [no-topromise](docs/rules/no-topromise.md) | Disallow use of the `toPromise` method. | πŸ”’ | | πŸ’‘ | πŸ’­ | |
111
+ | [no-unbound-methods](docs/rules/no-unbound-methods.md) | Disallow passing unbound methods. | βœ… πŸ”’ | | | πŸ’­ | |
112
+ | [no-unsafe-catch](docs/rules/no-unsafe-catch.md) | Disallow unsafe `catchError` usage in effects and epics. | | | | πŸ’­ | |
113
+ | [no-unsafe-first](docs/rules/no-unsafe-first.md) | Disallow unsafe `first`/`take` usage in effects and epics. | | | | πŸ’­ | |
114
+ | [no-unsafe-subject-next](docs/rules/no-unsafe-subject-next.md) | Disallow unsafe optional `next` calls. | βœ… πŸ”’ | | | πŸ’­ | |
115
+ | [no-unsafe-switchmap](docs/rules/no-unsafe-switchmap.md) | Disallow unsafe `switchMap` usage in effects and epics. | | | | πŸ’­ | |
116
+ | [no-unsafe-takeuntil](docs/rules/no-unsafe-takeuntil.md) | Disallow applying operators after `takeUntil`. | βœ… πŸ”’ | | | πŸ’­ | |
117
+ | [prefer-observer](docs/rules/prefer-observer.md) | Disallow passing separate handlers to `subscribe` and `tap`. | πŸ”’ | πŸ”§ | πŸ’‘ | πŸ’­ | |
118
+ | [prefer-root-operators](docs/rules/prefer-root-operators.md) | Disallow importing operators from `rxjs/operators`. | πŸ”’ | πŸ”§ | πŸ’‘ | | |
119
+ | [suffix-subjects](docs/rules/suffix-subjects.md) | Enforce the use of a suffix in subject identifiers. | | | | πŸ’­ | |
120
+ | [throw-error](docs/rules/throw-error.md) | Enforce passing only `Error` values to `throwError`. | πŸ”’ | | | πŸ’­ | |
112
121
 
113
122
  <!-- end auto-generated rules list -->
package/dist/index.d.mts CHANGED
@@ -2,7 +2,7 @@ import { TSESLint } from '@typescript-eslint/utils';
2
2
 
3
3
  interface RxjsXRuleDocs {
4
4
  description: string;
5
- recommended?: boolean;
5
+ recommended?: TSESLint.RuleRecommendation | TSESLint.RuleRecommendationAcrossConfigs<unknown[]>;
6
6
  requiresTypeChecking?: boolean;
7
7
  }
8
8
 
@@ -23,13 +23,48 @@ declare const rxjsX: {
23
23
  'rxjs-x/no-internal': "error";
24
24
  'rxjs-x/no-nested-subscribe': "error";
25
25
  'rxjs-x/no-redundant-notify': "error";
26
- 'rxjs-x/no-sharereplay': ["error", {
27
- allowConfig: boolean;
26
+ 'rxjs-x/no-sharereplay': "error";
27
+ 'rxjs-x/no-subject-unsubscribe': "error";
28
+ 'rxjs-x/no-unbound-methods': "error";
29
+ 'rxjs-x/no-unsafe-subject-next': "error";
30
+ 'rxjs-x/no-unsafe-takeuntil': "error";
31
+ };
32
+ };
33
+ strict: {
34
+ plugins: {
35
+ 'rxjs-x': TSESLint.FlatConfig.Plugin;
36
+ };
37
+ rules: {
38
+ 'rxjs-x/no-async-subscribe': "error";
39
+ 'rxjs-x/no-create': "error";
40
+ 'rxjs-x/no-explicit-generics': "error";
41
+ 'rxjs-x/no-exposed-subjects': "error";
42
+ 'rxjs-x/no-ignored-default-value': "error";
43
+ 'rxjs-x/no-ignored-error': "error";
44
+ 'rxjs-x/no-ignored-notifier': "error";
45
+ 'rxjs-x/no-ignored-observable': "error";
46
+ 'rxjs-x/no-ignored-replay-buffer': "error";
47
+ 'rxjs-x/no-ignored-takewhile-value': "error";
48
+ 'rxjs-x/no-implicit-any-catch': ["error", {
49
+ allowExplicitAny: false;
28
50
  }];
51
+ 'rxjs-x/no-index': "error";
52
+ 'rxjs-x/no-internal': "error";
53
+ 'rxjs-x/no-nested-subscribe': "error";
54
+ 'rxjs-x/no-redundant-notify': "error";
55
+ 'rxjs-x/no-sharereplay': "error";
56
+ 'rxjs-x/no-subclass': "error";
29
57
  'rxjs-x/no-subject-unsubscribe': "error";
58
+ 'rxjs-x/no-topromise': "error";
30
59
  'rxjs-x/no-unbound-methods': "error";
31
60
  'rxjs-x/no-unsafe-subject-next': "error";
32
61
  'rxjs-x/no-unsafe-takeuntil': "error";
62
+ 'rxjs-x/prefer-observer': "error";
63
+ 'rxjs-x/prefer-root-operators': "error";
64
+ 'rxjs-x/throw-error': ["error", {
65
+ allowThrowingAny: false;
66
+ allowThrowingUnknown: false;
67
+ }];
33
68
  };
34
69
  };
35
70
  };
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import { TSESLint } from '@typescript-eslint/utils';
2
2
 
3
3
  interface RxjsXRuleDocs {
4
4
  description: string;
5
- recommended?: boolean;
5
+ recommended?: TSESLint.RuleRecommendation | TSESLint.RuleRecommendationAcrossConfigs<unknown[]>;
6
6
  requiresTypeChecking?: boolean;
7
7
  }
8
8
 
@@ -23,13 +23,48 @@ declare const rxjsX: {
23
23
  'rxjs-x/no-internal': "error";
24
24
  'rxjs-x/no-nested-subscribe': "error";
25
25
  'rxjs-x/no-redundant-notify': "error";
26
- 'rxjs-x/no-sharereplay': ["error", {
27
- allowConfig: boolean;
26
+ 'rxjs-x/no-sharereplay': "error";
27
+ 'rxjs-x/no-subject-unsubscribe': "error";
28
+ 'rxjs-x/no-unbound-methods': "error";
29
+ 'rxjs-x/no-unsafe-subject-next': "error";
30
+ 'rxjs-x/no-unsafe-takeuntil': "error";
31
+ };
32
+ };
33
+ strict: {
34
+ plugins: {
35
+ 'rxjs-x': TSESLint.FlatConfig.Plugin;
36
+ };
37
+ rules: {
38
+ 'rxjs-x/no-async-subscribe': "error";
39
+ 'rxjs-x/no-create': "error";
40
+ 'rxjs-x/no-explicit-generics': "error";
41
+ 'rxjs-x/no-exposed-subjects': "error";
42
+ 'rxjs-x/no-ignored-default-value': "error";
43
+ 'rxjs-x/no-ignored-error': "error";
44
+ 'rxjs-x/no-ignored-notifier': "error";
45
+ 'rxjs-x/no-ignored-observable': "error";
46
+ 'rxjs-x/no-ignored-replay-buffer': "error";
47
+ 'rxjs-x/no-ignored-takewhile-value': "error";
48
+ 'rxjs-x/no-implicit-any-catch': ["error", {
49
+ allowExplicitAny: false;
28
50
  }];
51
+ 'rxjs-x/no-index': "error";
52
+ 'rxjs-x/no-internal': "error";
53
+ 'rxjs-x/no-nested-subscribe': "error";
54
+ 'rxjs-x/no-redundant-notify': "error";
55
+ 'rxjs-x/no-sharereplay': "error";
56
+ 'rxjs-x/no-subclass': "error";
29
57
  'rxjs-x/no-subject-unsubscribe': "error";
58
+ 'rxjs-x/no-topromise': "error";
30
59
  'rxjs-x/no-unbound-methods': "error";
31
60
  'rxjs-x/no-unsafe-subject-next': "error";
32
61
  'rxjs-x/no-unsafe-takeuntil': "error";
62
+ 'rxjs-x/prefer-observer': "error";
63
+ 'rxjs-x/prefer-root-operators': "error";
64
+ 'rxjs-x/throw-error': ["error", {
65
+ allowThrowingAny: false;
66
+ allowThrowingUnknown: false;
67
+ }];
33
68
  };
34
69
  };
35
70
  };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
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.2";
3
+ var version = "0.4.0";
4
4
 
5
5
  // src/configs/recommended.ts
6
6
  var createRecommendedConfig = (plugin2) => ({
@@ -18,7 +18,7 @@ var createRecommendedConfig = (plugin2) => ({
18
18
  "rxjs-x/no-internal": "error",
19
19
  "rxjs-x/no-nested-subscribe": "error",
20
20
  "rxjs-x/no-redundant-notify": "error",
21
- "rxjs-x/no-sharereplay": ["error", { allowConfig: true }],
21
+ "rxjs-x/no-sharereplay": "error",
22
22
  "rxjs-x/no-subject-unsubscribe": "error",
23
23
  "rxjs-x/no-unbound-methods": "error",
24
24
  "rxjs-x/no-unsafe-subject-next": "error",
@@ -26,6 +26,45 @@ var createRecommendedConfig = (plugin2) => ({
26
26
  }
27
27
  });
28
28
 
29
+ // src/configs/strict.ts
30
+ var createStrictConfig = (plugin2) => ({
31
+ plugins: {
32
+ "rxjs-x": plugin2
33
+ },
34
+ rules: {
35
+ "rxjs-x/no-async-subscribe": "error",
36
+ "rxjs-x/no-create": "error",
37
+ "rxjs-x/no-explicit-generics": "error",
38
+ "rxjs-x/no-exposed-subjects": "error",
39
+ "rxjs-x/no-ignored-default-value": "error",
40
+ "rxjs-x/no-ignored-error": "error",
41
+ "rxjs-x/no-ignored-notifier": "error",
42
+ "rxjs-x/no-ignored-observable": "error",
43
+ "rxjs-x/no-ignored-replay-buffer": "error",
44
+ "rxjs-x/no-ignored-takewhile-value": "error",
45
+ "rxjs-x/no-implicit-any-catch": ["error", {
46
+ allowExplicitAny: false
47
+ }],
48
+ "rxjs-x/no-index": "error",
49
+ "rxjs-x/no-internal": "error",
50
+ "rxjs-x/no-nested-subscribe": "error",
51
+ "rxjs-x/no-redundant-notify": "error",
52
+ "rxjs-x/no-sharereplay": "error",
53
+ "rxjs-x/no-subclass": "error",
54
+ "rxjs-x/no-subject-unsubscribe": "error",
55
+ "rxjs-x/no-topromise": "error",
56
+ "rxjs-x/no-unbound-methods": "error",
57
+ "rxjs-x/no-unsafe-subject-next": "error",
58
+ "rxjs-x/no-unsafe-takeuntil": "error",
59
+ "rxjs-x/prefer-observer": "error",
60
+ "rxjs-x/prefer-root-operators": "error",
61
+ "rxjs-x/throw-error": ["error", {
62
+ allowThrowingAny: false,
63
+ allowThrowingUnknown: false
64
+ }]
65
+ }
66
+ });
67
+
29
68
  // src/rules/ban-observables.ts
30
69
  var _utils = require('@typescript-eslint/utils');
31
70
  var _commontags = require('common-tags');
@@ -782,7 +821,7 @@ var noAsyncSubscribeRule = ruleCreator({
782
821
  meta: {
783
822
  docs: {
784
823
  description: "Disallow passing `async` functions to `subscribe`.",
785
- recommended: true,
824
+ recommended: "recommended",
786
825
  requiresTypeChecking: true
787
826
  },
788
827
  messages: {
@@ -890,7 +929,7 @@ var noCreateRule = ruleCreator({
890
929
  meta: {
891
930
  docs: {
892
931
  description: "Disallow the static `Observable.create` function.",
893
- recommended: true,
932
+ recommended: "recommended",
894
933
  requiresTypeChecking: true
895
934
  },
896
935
  messages: {
@@ -1032,7 +1071,8 @@ var noExplicitGenericsRule = ruleCreator({
1032
1071
  defaultOptions: [],
1033
1072
  meta: {
1034
1073
  docs: {
1035
- description: "Disallow unnecessary explicit generic type arguments."
1074
+ description: "Disallow unnecessary explicit generic type arguments.",
1075
+ recommended: "strict"
1036
1076
  },
1037
1077
  messages: {
1038
1078
  forbidden: "Explicit generic type arguments are forbidden."
@@ -1085,6 +1125,7 @@ var noExposedSubjectsRule = ruleCreator({
1085
1125
  meta: {
1086
1126
  docs: {
1087
1127
  description: "Disallow public and protected subjects.",
1128
+ recommended: "strict",
1088
1129
  requiresTypeChecking: true
1089
1130
  },
1090
1131
  messages: {
@@ -1284,6 +1325,7 @@ var noIgnoredDefaultValueRule = ruleCreator({
1284
1325
  meta: {
1285
1326
  docs: {
1286
1327
  description: "Disallow using `firstValueFrom`, `lastValueFrom`, `first`, and `last` without specifying a default value.",
1328
+ recommended: "strict",
1287
1329
  requiresTypeChecking: true
1288
1330
  },
1289
1331
  messages: {
@@ -1386,6 +1428,7 @@ var noIgnoredErrorRule = ruleCreator({
1386
1428
  meta: {
1387
1429
  docs: {
1388
1430
  description: "Disallow calling `subscribe` without specifying an error handler.",
1431
+ recommended: "strict",
1389
1432
  requiresTypeChecking: true
1390
1433
  },
1391
1434
  messages: {
@@ -1450,7 +1493,7 @@ var noIgnoredNotifierRule = ruleCreator({
1450
1493
  meta: {
1451
1494
  docs: {
1452
1495
  description: "Disallow observables not composed from the `repeatWhen` or `retryWhen` notifier.",
1453
- recommended: true,
1496
+ recommended: "recommended",
1454
1497
  requiresTypeChecking: true
1455
1498
  },
1456
1499
  messages: {
@@ -1522,6 +1565,7 @@ var noIgnoredObservableRule = ruleCreator({
1522
1565
  meta: {
1523
1566
  docs: {
1524
1567
  description: "Disallow ignoring observables returned by functions.",
1568
+ recommended: "strict",
1525
1569
  requiresTypeChecking: true
1526
1570
  },
1527
1571
  messages: {
@@ -1552,7 +1596,7 @@ var noIgnoredReplayBufferRule = ruleCreator({
1552
1596
  meta: {
1553
1597
  docs: {
1554
1598
  description: "Disallow using `ReplaySubject`, `publishReplay` or `shareReplay` without specifying the buffer size.",
1555
- recommended: true
1599
+ recommended: "recommended"
1556
1600
  },
1557
1601
  messages: {
1558
1602
  forbidden: "Ignoring the buffer size is forbidden."
@@ -1678,7 +1722,7 @@ var noIgnoredTakewhileValueRule = ruleCreator({
1678
1722
  meta: {
1679
1723
  docs: {
1680
1724
  description: "Disallow ignoring the value within `takeWhile`.",
1681
- recommended: true
1725
+ recommended: "recommended"
1682
1726
  },
1683
1727
  messages: {
1684
1728
  forbidden: "Ignoring the value within takeWhile is forbidden."
@@ -1742,7 +1786,12 @@ var noImplicitAnyCatchRule = ruleCreator({
1742
1786
  meta: {
1743
1787
  docs: {
1744
1788
  description: "Disallow implicit `any` error parameters in `catchError` operators.",
1745
- recommended: true,
1789
+ recommended: {
1790
+ recommended: true,
1791
+ strict: [{
1792
+ allowExplicitAny: false
1793
+ }]
1794
+ },
1746
1795
  requiresTypeChecking: true
1747
1796
  },
1748
1797
  fixable: "code",
@@ -1760,7 +1809,7 @@ var noImplicitAnyCatchRule = ruleCreator({
1760
1809
  allowExplicitAny: {
1761
1810
  type: "boolean",
1762
1811
  description: "Allow error variable to be explicitly typed as `any`.",
1763
- default: false
1812
+ default: true
1764
1813
  }
1765
1814
  },
1766
1815
  type: "object"
@@ -1771,7 +1820,7 @@ var noImplicitAnyCatchRule = ruleCreator({
1771
1820
  name: "no-implicit-any-catch",
1772
1821
  create: (context) => {
1773
1822
  const [config = {}] = context.options;
1774
- const { allowExplicitAny = false } = config;
1823
+ const { allowExplicitAny = true } = config;
1775
1824
  const { couldBeObservable } = getTypeServices(context);
1776
1825
  const sourceCode = context.sourceCode;
1777
1826
  function checkCallback(callback) {
@@ -1880,7 +1929,7 @@ var noIndexRule = ruleCreator({
1880
1929
  meta: {
1881
1930
  docs: {
1882
1931
  description: "Disallow importing index modules.",
1883
- recommended: true
1932
+ recommended: "recommended"
1884
1933
  },
1885
1934
  messages: {
1886
1935
  forbidden: "RxJS imports from index modules are forbidden."
@@ -1907,7 +1956,7 @@ var noInternalRule = ruleCreator({
1907
1956
  meta: {
1908
1957
  docs: {
1909
1958
  description: "Disallow importing internal modules.",
1910
- recommended: true
1959
+ recommended: "recommended"
1911
1960
  },
1912
1961
  fixable: "code",
1913
1962
  hasSuggestions: true,
@@ -1983,7 +2032,7 @@ var noNestedSubscribeRule = ruleCreator({
1983
2032
  meta: {
1984
2033
  docs: {
1985
2034
  description: "Disallow calling `subscribe` within a `subscribe` callback.",
1986
- recommended: true,
2035
+ recommended: "recommended",
1987
2036
  requiresTypeChecking: true
1988
2037
  },
1989
2038
  messages: {
@@ -2027,7 +2076,7 @@ var noRedundantNotifyRule = ruleCreator({
2027
2076
  meta: {
2028
2077
  docs: {
2029
2078
  description: "Disallow sending redundant notifications from completed or errored observables.",
2030
- recommended: true,
2079
+ recommended: "recommended",
2031
2080
  requiresTypeChecking: true
2032
2081
  },
2033
2082
  messages: {
@@ -2106,7 +2155,7 @@ var noSharereplayRule = ruleCreator({
2106
2155
  meta: {
2107
2156
  docs: {
2108
2157
  description: "Disallow unsafe `shareReplay` usage.",
2109
- recommended: true
2158
+ recommended: "recommended"
2110
2159
  },
2111
2160
  messages: {
2112
2161
  forbidden: "shareReplay is forbidden.",
@@ -2149,6 +2198,7 @@ var noSubclassRule = ruleCreator({
2149
2198
  meta: {
2150
2199
  docs: {
2151
2200
  description: "Disallow subclassing RxJS classes.",
2201
+ recommended: "strict",
2152
2202
  requiresTypeChecking: true
2153
2203
  },
2154
2204
  messages: {
@@ -2192,7 +2242,7 @@ var noSubjectUnsubscribeRule = ruleCreator({
2192
2242
  meta: {
2193
2243
  docs: {
2194
2244
  description: "Disallow calling the `unsubscribe` method of subjects.",
2195
- recommended: true,
2245
+ recommended: "recommended",
2196
2246
  requiresTypeChecking: true
2197
2247
  },
2198
2248
  messages: {
@@ -2335,6 +2385,7 @@ var noTopromiseRule = ruleCreator({
2335
2385
  meta: {
2336
2386
  docs: {
2337
2387
  description: "Disallow use of the `toPromise` method.",
2388
+ recommended: "strict",
2338
2389
  requiresTypeChecking: true
2339
2390
  },
2340
2391
  hasSuggestions: true,
@@ -2429,7 +2480,7 @@ var noUnboundMethodsRule = ruleCreator({
2429
2480
  meta: {
2430
2481
  docs: {
2431
2482
  description: "Disallow passing unbound methods.",
2432
- recommended: true,
2483
+ recommended: "recommended",
2433
2484
  requiresTypeChecking: true
2434
2485
  },
2435
2486
  messages: {
@@ -2626,7 +2677,7 @@ var noUnsafeSubjectNext = ruleCreator({
2626
2677
  meta: {
2627
2678
  docs: {
2628
2679
  description: "Disallow unsafe optional `next` calls.",
2629
- recommended: true,
2680
+ recommended: "recommended",
2630
2681
  requiresTypeChecking: true
2631
2682
  },
2632
2683
  messages: {
@@ -2827,7 +2878,7 @@ var noUnsafeTakeuntilRule = ruleCreator({
2827
2878
  meta: {
2828
2879
  docs: {
2829
2880
  description: "Disallow applying operators after `takeUntil`.",
2830
- recommended: true,
2881
+ recommended: "recommended",
2831
2882
  requiresTypeChecking: true
2832
2883
  },
2833
2884
  messages: {
@@ -2908,6 +2959,7 @@ var preferObserverRule = ruleCreator({
2908
2959
  meta: {
2909
2960
  docs: {
2910
2961
  description: "Disallow passing separate handlers to `subscribe` and `tap`.",
2962
+ recommended: "strict",
2911
2963
  requiresTypeChecking: true
2912
2964
  },
2913
2965
  fixable: "code",
@@ -3016,7 +3068,8 @@ var preferRootOperatorsRule = ruleCreator({
3016
3068
  defaultOptions: [],
3017
3069
  meta: {
3018
3070
  docs: {
3019
- description: "Disallow importing operators from `rxjs/operators`."
3071
+ description: "Disallow importing operators from `rxjs/operators`.",
3072
+ recommended: "strict"
3020
3073
  },
3021
3074
  fixable: "code",
3022
3075
  hasSuggestions: true,
@@ -3343,6 +3396,9 @@ var throwErrorRule = ruleCreator({
3343
3396
  meta: {
3344
3397
  docs: {
3345
3398
  description: "Enforce passing only `Error` values to `throwError`.",
3399
+ recommended: {
3400
+ strict: [{ allowThrowingAny: false, allowThrowingUnknown: false }]
3401
+ },
3346
3402
  requiresTypeChecking: true
3347
3403
  },
3348
3404
  messages: {
@@ -3461,7 +3517,8 @@ var plugin = {
3461
3517
  var rxjsX = {
3462
3518
  ...plugin,
3463
3519
  configs: {
3464
- recommended: createRecommendedConfig(plugin)
3520
+ recommended: createRecommendedConfig(plugin),
3521
+ strict: createStrictConfig(plugin)
3465
3522
  }
3466
3523
  };
3467
3524
  var src_default = rxjsX;
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  // package.json
2
2
  var name = "eslint-plugin-rxjs-x";
3
- var version = "0.3.2";
3
+ var version = "0.4.0";
4
4
 
5
5
  // src/configs/recommended.ts
6
6
  var createRecommendedConfig = (plugin2) => ({
@@ -18,7 +18,7 @@ var createRecommendedConfig = (plugin2) => ({
18
18
  "rxjs-x/no-internal": "error",
19
19
  "rxjs-x/no-nested-subscribe": "error",
20
20
  "rxjs-x/no-redundant-notify": "error",
21
- "rxjs-x/no-sharereplay": ["error", { allowConfig: true }],
21
+ "rxjs-x/no-sharereplay": "error",
22
22
  "rxjs-x/no-subject-unsubscribe": "error",
23
23
  "rxjs-x/no-unbound-methods": "error",
24
24
  "rxjs-x/no-unsafe-subject-next": "error",
@@ -26,6 +26,45 @@ var createRecommendedConfig = (plugin2) => ({
26
26
  }
27
27
  });
28
28
 
29
+ // src/configs/strict.ts
30
+ var createStrictConfig = (plugin2) => ({
31
+ plugins: {
32
+ "rxjs-x": plugin2
33
+ },
34
+ rules: {
35
+ "rxjs-x/no-async-subscribe": "error",
36
+ "rxjs-x/no-create": "error",
37
+ "rxjs-x/no-explicit-generics": "error",
38
+ "rxjs-x/no-exposed-subjects": "error",
39
+ "rxjs-x/no-ignored-default-value": "error",
40
+ "rxjs-x/no-ignored-error": "error",
41
+ "rxjs-x/no-ignored-notifier": "error",
42
+ "rxjs-x/no-ignored-observable": "error",
43
+ "rxjs-x/no-ignored-replay-buffer": "error",
44
+ "rxjs-x/no-ignored-takewhile-value": "error",
45
+ "rxjs-x/no-implicit-any-catch": ["error", {
46
+ allowExplicitAny: false
47
+ }],
48
+ "rxjs-x/no-index": "error",
49
+ "rxjs-x/no-internal": "error",
50
+ "rxjs-x/no-nested-subscribe": "error",
51
+ "rxjs-x/no-redundant-notify": "error",
52
+ "rxjs-x/no-sharereplay": "error",
53
+ "rxjs-x/no-subclass": "error",
54
+ "rxjs-x/no-subject-unsubscribe": "error",
55
+ "rxjs-x/no-topromise": "error",
56
+ "rxjs-x/no-unbound-methods": "error",
57
+ "rxjs-x/no-unsafe-subject-next": "error",
58
+ "rxjs-x/no-unsafe-takeuntil": "error",
59
+ "rxjs-x/prefer-observer": "error",
60
+ "rxjs-x/prefer-root-operators": "error",
61
+ "rxjs-x/throw-error": ["error", {
62
+ allowThrowingAny: false,
63
+ allowThrowingUnknown: false
64
+ }]
65
+ }
66
+ });
67
+
29
68
  // src/rules/ban-observables.ts
30
69
  import { AST_NODE_TYPES } from "@typescript-eslint/utils";
31
70
  import { stripIndent } from "common-tags";
@@ -782,7 +821,7 @@ var noAsyncSubscribeRule = ruleCreator({
782
821
  meta: {
783
822
  docs: {
784
823
  description: "Disallow passing `async` functions to `subscribe`.",
785
- recommended: true,
824
+ recommended: "recommended",
786
825
  requiresTypeChecking: true
787
826
  },
788
827
  messages: {
@@ -890,7 +929,7 @@ var noCreateRule = ruleCreator({
890
929
  meta: {
891
930
  docs: {
892
931
  description: "Disallow the static `Observable.create` function.",
893
- recommended: true,
932
+ recommended: "recommended",
894
933
  requiresTypeChecking: true
895
934
  },
896
935
  messages: {
@@ -1032,7 +1071,8 @@ var noExplicitGenericsRule = ruleCreator({
1032
1071
  defaultOptions: [],
1033
1072
  meta: {
1034
1073
  docs: {
1035
- description: "Disallow unnecessary explicit generic type arguments."
1074
+ description: "Disallow unnecessary explicit generic type arguments.",
1075
+ recommended: "strict"
1036
1076
  },
1037
1077
  messages: {
1038
1078
  forbidden: "Explicit generic type arguments are forbidden."
@@ -1085,6 +1125,7 @@ var noExposedSubjectsRule = ruleCreator({
1085
1125
  meta: {
1086
1126
  docs: {
1087
1127
  description: "Disallow public and protected subjects.",
1128
+ recommended: "strict",
1088
1129
  requiresTypeChecking: true
1089
1130
  },
1090
1131
  messages: {
@@ -1284,6 +1325,7 @@ var noIgnoredDefaultValueRule = ruleCreator({
1284
1325
  meta: {
1285
1326
  docs: {
1286
1327
  description: "Disallow using `firstValueFrom`, `lastValueFrom`, `first`, and `last` without specifying a default value.",
1328
+ recommended: "strict",
1287
1329
  requiresTypeChecking: true
1288
1330
  },
1289
1331
  messages: {
@@ -1386,6 +1428,7 @@ var noIgnoredErrorRule = ruleCreator({
1386
1428
  meta: {
1387
1429
  docs: {
1388
1430
  description: "Disallow calling `subscribe` without specifying an error handler.",
1431
+ recommended: "strict",
1389
1432
  requiresTypeChecking: true
1390
1433
  },
1391
1434
  messages: {
@@ -1450,7 +1493,7 @@ var noIgnoredNotifierRule = ruleCreator({
1450
1493
  meta: {
1451
1494
  docs: {
1452
1495
  description: "Disallow observables not composed from the `repeatWhen` or `retryWhen` notifier.",
1453
- recommended: true,
1496
+ recommended: "recommended",
1454
1497
  requiresTypeChecking: true
1455
1498
  },
1456
1499
  messages: {
@@ -1522,6 +1565,7 @@ var noIgnoredObservableRule = ruleCreator({
1522
1565
  meta: {
1523
1566
  docs: {
1524
1567
  description: "Disallow ignoring observables returned by functions.",
1568
+ recommended: "strict",
1525
1569
  requiresTypeChecking: true
1526
1570
  },
1527
1571
  messages: {
@@ -1552,7 +1596,7 @@ var noIgnoredReplayBufferRule = ruleCreator({
1552
1596
  meta: {
1553
1597
  docs: {
1554
1598
  description: "Disallow using `ReplaySubject`, `publishReplay` or `shareReplay` without specifying the buffer size.",
1555
- recommended: true
1599
+ recommended: "recommended"
1556
1600
  },
1557
1601
  messages: {
1558
1602
  forbidden: "Ignoring the buffer size is forbidden."
@@ -1678,7 +1722,7 @@ var noIgnoredTakewhileValueRule = ruleCreator({
1678
1722
  meta: {
1679
1723
  docs: {
1680
1724
  description: "Disallow ignoring the value within `takeWhile`.",
1681
- recommended: true
1725
+ recommended: "recommended"
1682
1726
  },
1683
1727
  messages: {
1684
1728
  forbidden: "Ignoring the value within takeWhile is forbidden."
@@ -1742,7 +1786,12 @@ var noImplicitAnyCatchRule = ruleCreator({
1742
1786
  meta: {
1743
1787
  docs: {
1744
1788
  description: "Disallow implicit `any` error parameters in `catchError` operators.",
1745
- recommended: true,
1789
+ recommended: {
1790
+ recommended: true,
1791
+ strict: [{
1792
+ allowExplicitAny: false
1793
+ }]
1794
+ },
1746
1795
  requiresTypeChecking: true
1747
1796
  },
1748
1797
  fixable: "code",
@@ -1760,7 +1809,7 @@ var noImplicitAnyCatchRule = ruleCreator({
1760
1809
  allowExplicitAny: {
1761
1810
  type: "boolean",
1762
1811
  description: "Allow error variable to be explicitly typed as `any`.",
1763
- default: false
1812
+ default: true
1764
1813
  }
1765
1814
  },
1766
1815
  type: "object"
@@ -1771,7 +1820,7 @@ var noImplicitAnyCatchRule = ruleCreator({
1771
1820
  name: "no-implicit-any-catch",
1772
1821
  create: (context) => {
1773
1822
  const [config = {}] = context.options;
1774
- const { allowExplicitAny = false } = config;
1823
+ const { allowExplicitAny = true } = config;
1775
1824
  const { couldBeObservable } = getTypeServices(context);
1776
1825
  const sourceCode = context.sourceCode;
1777
1826
  function checkCallback(callback) {
@@ -1880,7 +1929,7 @@ var noIndexRule = ruleCreator({
1880
1929
  meta: {
1881
1930
  docs: {
1882
1931
  description: "Disallow importing index modules.",
1883
- recommended: true
1932
+ recommended: "recommended"
1884
1933
  },
1885
1934
  messages: {
1886
1935
  forbidden: "RxJS imports from index modules are forbidden."
@@ -1907,7 +1956,7 @@ var noInternalRule = ruleCreator({
1907
1956
  meta: {
1908
1957
  docs: {
1909
1958
  description: "Disallow importing internal modules.",
1910
- recommended: true
1959
+ recommended: "recommended"
1911
1960
  },
1912
1961
  fixable: "code",
1913
1962
  hasSuggestions: true,
@@ -1983,7 +2032,7 @@ var noNestedSubscribeRule = ruleCreator({
1983
2032
  meta: {
1984
2033
  docs: {
1985
2034
  description: "Disallow calling `subscribe` within a `subscribe` callback.",
1986
- recommended: true,
2035
+ recommended: "recommended",
1987
2036
  requiresTypeChecking: true
1988
2037
  },
1989
2038
  messages: {
@@ -2027,7 +2076,7 @@ var noRedundantNotifyRule = ruleCreator({
2027
2076
  meta: {
2028
2077
  docs: {
2029
2078
  description: "Disallow sending redundant notifications from completed or errored observables.",
2030
- recommended: true,
2079
+ recommended: "recommended",
2031
2080
  requiresTypeChecking: true
2032
2081
  },
2033
2082
  messages: {
@@ -2106,7 +2155,7 @@ var noSharereplayRule = ruleCreator({
2106
2155
  meta: {
2107
2156
  docs: {
2108
2157
  description: "Disallow unsafe `shareReplay` usage.",
2109
- recommended: true
2158
+ recommended: "recommended"
2110
2159
  },
2111
2160
  messages: {
2112
2161
  forbidden: "shareReplay is forbidden.",
@@ -2149,6 +2198,7 @@ var noSubclassRule = ruleCreator({
2149
2198
  meta: {
2150
2199
  docs: {
2151
2200
  description: "Disallow subclassing RxJS classes.",
2201
+ recommended: "strict",
2152
2202
  requiresTypeChecking: true
2153
2203
  },
2154
2204
  messages: {
@@ -2192,7 +2242,7 @@ var noSubjectUnsubscribeRule = ruleCreator({
2192
2242
  meta: {
2193
2243
  docs: {
2194
2244
  description: "Disallow calling the `unsubscribe` method of subjects.",
2195
- recommended: true,
2245
+ recommended: "recommended",
2196
2246
  requiresTypeChecking: true
2197
2247
  },
2198
2248
  messages: {
@@ -2335,6 +2385,7 @@ var noTopromiseRule = ruleCreator({
2335
2385
  meta: {
2336
2386
  docs: {
2337
2387
  description: "Disallow use of the `toPromise` method.",
2388
+ recommended: "strict",
2338
2389
  requiresTypeChecking: true
2339
2390
  },
2340
2391
  hasSuggestions: true,
@@ -2429,7 +2480,7 @@ var noUnboundMethodsRule = ruleCreator({
2429
2480
  meta: {
2430
2481
  docs: {
2431
2482
  description: "Disallow passing unbound methods.",
2432
- recommended: true,
2483
+ recommended: "recommended",
2433
2484
  requiresTypeChecking: true
2434
2485
  },
2435
2486
  messages: {
@@ -2626,7 +2677,7 @@ var noUnsafeSubjectNext = ruleCreator({
2626
2677
  meta: {
2627
2678
  docs: {
2628
2679
  description: "Disallow unsafe optional `next` calls.",
2629
- recommended: true,
2680
+ recommended: "recommended",
2630
2681
  requiresTypeChecking: true
2631
2682
  },
2632
2683
  messages: {
@@ -2827,7 +2878,7 @@ var noUnsafeTakeuntilRule = ruleCreator({
2827
2878
  meta: {
2828
2879
  docs: {
2829
2880
  description: "Disallow applying operators after `takeUntil`.",
2830
- recommended: true,
2881
+ recommended: "recommended",
2831
2882
  requiresTypeChecking: true
2832
2883
  },
2833
2884
  messages: {
@@ -2908,6 +2959,7 @@ var preferObserverRule = ruleCreator({
2908
2959
  meta: {
2909
2960
  docs: {
2910
2961
  description: "Disallow passing separate handlers to `subscribe` and `tap`.",
2962
+ recommended: "strict",
2911
2963
  requiresTypeChecking: true
2912
2964
  },
2913
2965
  fixable: "code",
@@ -3016,7 +3068,8 @@ var preferRootOperatorsRule = ruleCreator({
3016
3068
  defaultOptions: [],
3017
3069
  meta: {
3018
3070
  docs: {
3019
- description: "Disallow importing operators from `rxjs/operators`."
3071
+ description: "Disallow importing operators from `rxjs/operators`.",
3072
+ recommended: "strict"
3020
3073
  },
3021
3074
  fixable: "code",
3022
3075
  hasSuggestions: true,
@@ -3343,6 +3396,9 @@ var throwErrorRule = ruleCreator({
3343
3396
  meta: {
3344
3397
  docs: {
3345
3398
  description: "Enforce passing only `Error` values to `throwError`.",
3399
+ recommended: {
3400
+ strict: [{ allowThrowingAny: false, allowThrowingUnknown: false }]
3401
+ },
3346
3402
  requiresTypeChecking: true
3347
3403
  },
3348
3404
  messages: {
@@ -3461,7 +3517,8 @@ var plugin = {
3461
3517
  var rxjsX = {
3462
3518
  ...plugin,
3463
3519
  configs: {
3464
- recommended: createRecommendedConfig(plugin)
3520
+ recommended: createRecommendedConfig(plugin),
3521
+ strict: createStrictConfig(plugin)
3465
3522
  }
3466
3523
  };
3467
3524
  var src_default = rxjsX;
@@ -1,6 +1,6 @@
1
1
  # Disallow passing `async` functions to `subscribe` (`rxjs-x/no-async-subscribe`)
2
2
 
3
- πŸ’Ό This rule is enabled in the βœ… `recommended` config.
3
+ πŸ’Ό This rule is enabled in the following configs: βœ… `recommended`, πŸ”’ `strict`.
4
4
 
5
5
  πŸ’­ This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Disallow the static `Observable.create` function (`rxjs-x/no-create`)
2
2
 
3
- πŸ’Ό This rule is enabled in the βœ… `recommended` config.
3
+ πŸ’Ό This rule is enabled in the following configs: βœ… `recommended`, πŸ”’ `strict`.
4
4
 
5
5
  πŸ’­ This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).
6
6
 
@@ -1,5 +1,7 @@
1
1
  # Disallow unnecessary explicit generic type arguments (`rxjs-x/no-explicit-generics`)
2
2
 
3
+ πŸ’Ό This rule is enabled in the πŸ”’ `strict` config.
4
+
3
5
  <!-- end auto-generated rule header -->
4
6
 
5
7
  This rule prevents the use of explicit type arguments when the type arguments can be inferred.
@@ -1,5 +1,7 @@
1
1
  # Disallow public and protected subjects (`rxjs-x/no-exposed-subjects`)
2
2
 
3
+ πŸ’Ό This rule is enabled in the πŸ”’ `strict` config.
4
+
3
5
  πŸ’­ This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).
4
6
 
5
7
  <!-- end auto-generated rule header -->
@@ -1,5 +1,7 @@
1
1
  # Disallow using `firstValueFrom`, `lastValueFrom`, `first`, and `last` without specifying a default value (`rxjs-x/no-ignored-default-value`)
2
2
 
3
+ πŸ’Ό This rule is enabled in the πŸ”’ `strict` config.
4
+
3
5
  πŸ’­ This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).
4
6
 
5
7
  <!-- end auto-generated rule header -->
@@ -1,5 +1,7 @@
1
1
  # Disallow calling `subscribe` without specifying an error handler (`rxjs-x/no-ignored-error`)
2
2
 
3
+ πŸ’Ό This rule is enabled in the πŸ”’ `strict` config.
4
+
3
5
  πŸ’­ This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).
4
6
 
5
7
  <!-- end auto-generated rule header -->
@@ -1,6 +1,6 @@
1
1
  # Disallow observables not composed from the `repeatWhen` or `retryWhen` notifier (`rxjs-x/no-ignored-notifier`)
2
2
 
3
- πŸ’Ό This rule is enabled in the βœ… `recommended` config.
3
+ πŸ’Ό This rule is enabled in the following configs: βœ… `recommended`, πŸ”’ `strict`.
4
4
 
5
5
  πŸ’­ This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).
6
6
 
@@ -1,5 +1,7 @@
1
1
  # Disallow ignoring observables returned by functions (`rxjs-x/no-ignored-observable`)
2
2
 
3
+ πŸ’Ό This rule is enabled in the πŸ”’ `strict` config.
4
+
3
5
  πŸ’­ This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).
4
6
 
5
7
  <!-- end auto-generated rule header -->
@@ -1,6 +1,6 @@
1
1
  # Disallow using `ReplaySubject`, `publishReplay` or `shareReplay` without specifying the buffer size (`rxjs-x/no-ignored-replay-buffer`)
2
2
 
3
- πŸ’Ό This rule is enabled in the βœ… `recommended` config.
3
+ πŸ’Ό This rule is enabled in the following configs: βœ… `recommended`, πŸ”’ `strict`.
4
4
 
5
5
  <!-- end auto-generated rule header -->
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Disallow ignoring the value within `takeWhile` (`rxjs-x/no-ignored-takewhile-value`)
2
2
 
3
- πŸ’Ό This rule is enabled in the βœ… `recommended` config.
3
+ πŸ’Ό This rule is enabled in the following configs: βœ… `recommended`, πŸ”’ `strict`.
4
4
 
5
5
  <!-- end auto-generated rule header -->
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Disallow implicit `any` error parameters in `catchError` operators (`rxjs-x/no-implicit-any-catch`)
2
2
 
3
- πŸ’Ό This rule is enabled in the βœ… `recommended` config.
3
+ πŸ’Ό This rule is enabled in the following configs: βœ… `recommended`, πŸ”’ `strict`.
4
4
 
5
5
  πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).
6
6
 
@@ -74,11 +74,11 @@ throwError(() => new Error("Kaboom!")).pipe(
74
74
 
75
75
  | Name | Description | Type | Default |
76
76
  | :----------------- | :---------------------------------------------------- | :------ | :------ |
77
- | `allowExplicitAny` | Allow error variable to be explicitly typed as `any`. | Boolean | `false` |
77
+ | `allowExplicitAny` | Allow error variable to be explicitly typed as `any`. | Boolean | `true` |
78
78
 
79
79
  <!-- end auto-generated rule options list -->
80
80
 
81
- This rule accepts a single option which is an object with an `allowExplicitAny` property that determines whether or not the error variable can be explicitly typed as `any`. By default, the use of explicit `any` is forbidden.
81
+ This rule accepts a single option which is an object with an `allowExplicitAny` property that determines whether or not the error variable can be explicitly typed as `any`. By default, the use of explicit `any` is allowed.
82
82
 
83
83
  ```json
84
84
  {
@@ -1,6 +1,6 @@
1
1
  # Disallow importing index modules (`rxjs-x/no-index`)
2
2
 
3
- πŸ’Ό This rule is enabled in the βœ… `recommended` config.
3
+ πŸ’Ό This rule is enabled in the following configs: βœ… `recommended`, πŸ”’ `strict`.
4
4
 
5
5
  <!-- end auto-generated rule header -->
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Disallow importing internal modules (`rxjs-x/no-internal`)
2
2
 
3
- πŸ’Ό This rule is enabled in the βœ… `recommended` config.
3
+ πŸ’Ό This rule is enabled in the following configs: βœ… `recommended`, πŸ”’ `strict`.
4
4
 
5
5
  πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Disallow calling `subscribe` within a `subscribe` callback (`rxjs-x/no-nested-subscribe`)
2
2
 
3
- πŸ’Ό This rule is enabled in the βœ… `recommended` config.
3
+ πŸ’Ό This rule is enabled in the following configs: βœ… `recommended`, πŸ”’ `strict`.
4
4
 
5
5
  πŸ’­ This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Disallow sending redundant notifications from completed or errored observables (`rxjs-x/no-redundant-notify`)
2
2
 
3
- πŸ’Ό This rule is enabled in the βœ… `recommended` config.
3
+ πŸ’Ό This rule is enabled in the following configs: βœ… `recommended`, πŸ”’ `strict`.
4
4
 
5
5
  πŸ’­ This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Disallow unsafe `shareReplay` usage (`rxjs-x/no-sharereplay`)
2
2
 
3
- πŸ’Ό This rule is enabled in the βœ… `recommended` config.
3
+ πŸ’Ό This rule is enabled in the following configs: βœ… `recommended`, πŸ”’ `strict`.
4
4
 
5
5
  <!-- end auto-generated rule header -->
6
6
 
@@ -1,5 +1,7 @@
1
1
  # Disallow subclassing RxJS classes (`rxjs-x/no-subclass`)
2
2
 
3
+ πŸ’Ό This rule is enabled in the πŸ”’ `strict` config.
4
+
3
5
  πŸ’­ This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).
4
6
 
5
7
  <!-- end auto-generated rule header -->
@@ -1,6 +1,6 @@
1
1
  # Disallow calling the `unsubscribe` method of subjects (`rxjs-x/no-subject-unsubscribe`)
2
2
 
3
- πŸ’Ό This rule is enabled in the βœ… `recommended` config.
3
+ πŸ’Ό This rule is enabled in the following configs: βœ… `recommended`, πŸ”’ `strict`.
4
4
 
5
5
  πŸ’­ This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).
6
6
 
@@ -1,5 +1,7 @@
1
1
  # Disallow use of the `toPromise` method (`rxjs-x/no-topromise`)
2
2
 
3
+ πŸ’Ό This rule is enabled in the πŸ”’ `strict` config.
4
+
3
5
  πŸ’‘ This rule is manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).
4
6
 
5
7
  πŸ’­ This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).
@@ -1,6 +1,6 @@
1
1
  # Disallow passing unbound methods (`rxjs-x/no-unbound-methods`)
2
2
 
3
- πŸ’Ό This rule is enabled in the βœ… `recommended` config.
3
+ πŸ’Ό This rule is enabled in the following configs: βœ… `recommended`, πŸ”’ `strict`.
4
4
 
5
5
  πŸ’­ This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Disallow unsafe optional `next` calls (`rxjs-x/no-unsafe-subject-next`)
2
2
 
3
- πŸ’Ό This rule is enabled in the βœ… `recommended` config.
3
+ πŸ’Ό This rule is enabled in the following configs: βœ… `recommended`, πŸ”’ `strict`.
4
4
 
5
5
  πŸ’­ This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Disallow applying operators after `takeUntil` (`rxjs-x/no-unsafe-takeuntil`)
2
2
 
3
- πŸ’Ό This rule is enabled in the βœ… `recommended` config.
3
+ πŸ’Ό This rule is enabled in the following configs: βœ… `recommended`, πŸ”’ `strict`.
4
4
 
5
5
  πŸ’­ This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).
6
6
 
@@ -1,5 +1,7 @@
1
1
  # Disallow passing separate handlers to `subscribe` and `tap` (`rxjs-x/prefer-observer`)
2
2
 
3
+ πŸ’Ό This rule is enabled in the πŸ”’ `strict` config.
4
+
3
5
  πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).
4
6
 
5
7
  πŸ’­ This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).
@@ -46,3 +48,7 @@ This rule accepts a single option which is an object with an `allowNext` propert
46
48
  ]
47
49
  }
48
50
  ```
51
+
52
+ ## Further reading
53
+
54
+ - [Subscribe Arguments](https://rxjs.dev/deprecations/subscribe-arguments)
@@ -1,5 +1,7 @@
1
1
  # Disallow importing operators from `rxjs/operators` (`rxjs-x/prefer-root-operators`)
2
2
 
3
+ πŸ’Ό This rule is enabled in the πŸ”’ `strict` config.
4
+
3
5
  πŸ”§πŸ’‘ This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) and manually fixable by [editor suggestions](https://eslint.org/docs/latest/use/core-concepts#rule-suggestions).
4
6
 
5
7
  <!-- end auto-generated rule header -->
@@ -1,5 +1,7 @@
1
1
  # Enforce passing only `Error` values to `throwError` (`rxjs-x/throw-error`)
2
2
 
3
+ πŸ’Ό This rule is enabled in the πŸ”’ `strict` config.
4
+
3
5
  πŸ’­ This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).
4
6
 
5
7
  <!-- end auto-generated rule header -->
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eslint-plugin-rxjs-x",
3
3
  "type": "commonjs",
4
- "version": "0.3.2",
4
+ "version": "0.4.0",
5
5
  "packageManager": "yarn@4.5.1+sha512.341db9396b6e289fecc30cd7ab3af65060e05ebff4b3b47547b278b9e67b08f485ecd8c79006b405446262142c7a38154445ef7f17c1d5d1de7d90bf9ce7054d",
6
6
  "description": "ESLint v9+ plugin for RxJS",
7
7
  "author": "Jason Weinzierl <weinzierljason@gmail.com>",