Skip to content

Commit c97c29f

Browse files
feat(strict): remove no-explicit-generics from strict (#78)
There are known problems with this rule (#77), so we're removing it to avoid unnecessary problems for now.
1 parent b813600 commit c97c29f

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ The package includes the following rules.
8686
| [no-connectable](docs/rules/no-connectable.md) | Disallow operators that return connectable observables. | | | | 💭 | |
8787
| [no-create](docs/rules/no-create.md) | Disallow the static `Observable.create` function. | ✅ 🔒 | | | 💭 | |
8888
| [no-cyclic-action](docs/rules/no-cyclic-action.md) | Disallow cyclic actions in effects and epics. | | | | 💭 | |
89-
| [no-explicit-generics](docs/rules/no-explicit-generics.md) | Disallow unnecessary explicit generic type arguments. | 🔒 | | | | |
89+
| [no-explicit-generics](docs/rules/no-explicit-generics.md) | Disallow unnecessary explicit generic type arguments. | | | | | |
9090
| [no-exposed-subjects](docs/rules/no-exposed-subjects.md) | Disallow public and protected subjects. | 🔒 | | | 💭 | |
9191
| [no-finnish](docs/rules/no-finnish.md) | Disallow Finnish notation. | | | | 💭 | |
9292
| [no-floating-observables](docs/rules/no-floating-observables.md) | Require Observables to be handled appropriately. | 🔒 | | | 💭 | |

docs/rules/no-explicit-generics.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Disallow unnecessary explicit generic type arguments (`rxjs-x/no-explicit-generics`)
22

3-
💼 This rule is enabled in the 🔒 `strict` config.
4-
53
<!-- end auto-generated rule header -->
64

75
This rule prevents the use of explicit type arguments when the type arguments can be inferred.
@@ -21,3 +19,7 @@ Examples of **correct** code for this rule:
2119
import { BehaviorSubject } from "rxjs";
2220
const subject = new BehaviorSubject(42);
2321
```
22+
23+
## Known problems
24+
25+
- ([#77](https://github.com/JasonWeinzierl/eslint-plugin-rxjs-x/issues/77)) Type unions cause false positives e.g. `new BehaviorSubject<number | null>(null)` will be incorrectly caught by this rule.

src/configs/strict.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export const createStrictConfig = (
1010
rules: {
1111
'rxjs-x/no-async-subscribe': 'error',
1212
'rxjs-x/no-create': 'error',
13-
'rxjs-x/no-explicit-generics': 'error',
1413
'rxjs-x/no-exposed-subjects': 'error',
1514
'rxjs-x/no-floating-observables': 'error',
1615
'rxjs-x/no-ignored-default-value': 'error',

src/rules/no-explicit-generics.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export const noExplicitGenericsRule = ruleCreator({
77
meta: {
88
docs: {
99
description: 'Disallow unnecessary explicit generic type arguments.',
10-
recommended: 'strict',
1110
},
1211
messages: {
1312
forbidden: 'Explicit generic type arguments are forbidden.',

0 commit comments

Comments
 (0)