|
4 | 4 | [](https://www.npmjs.com/package/eslint-plugin-rxjs-x) |
5 | 5 | [](https://scorecard.dev/viewer/?uri=github.com/JasonWeinzierl/eslint-plugin-rxjs-x) |
6 | 6 |
|
| 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 | +
|
7 | 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. |
@@ -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 --> |
|
0 commit comments