Skip to content

Commit a83af05

Browse files
docs: auto-generate rule docs (#5)
- Add eslint-doc-generator and run on existing documentation. - Update existing rule descriptions to align across both rule description and markdown header. - Add Configs section to README. - Add markdownlint.
1 parent 0b47390 commit a83af05

File tree

87 files changed

+1004
-260
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+1004
-260
lines changed

.markdownlint.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"line-length": false
3+
}

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
There's nothing here, yet. Thanks for looking. I'll eventually get around to filling this out.
1+
# Contributing
2+
3+
There's nothing here, yet. Thanks for looking. I'll eventually get around to filling this out.

README.md

Lines changed: 57 additions & 43 deletions
Large diffs are not rendered by default.

docs/rules/ban-observables.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Avoid banned observable creators (`ban-observables`)
1+
# Disallow banned observable creators (`rxjs-x/ban-observables`)
2+
3+
<!-- end auto-generated rule header -->
24

35
This rule can be configured so that developers can ban any observable creators they want to avoid in their project.
46

docs/rules/ban-operators.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Avoid banned operators (`ban-operators`)
1+
# Disallow banned operators (`rxjs-x/ban-operators`)
2+
3+
<!-- end auto-generated rule header -->
24

35
This rule can be configured so that developers can ban any operators they want to avoid in their project.
46

docs/rules/finnish.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# Use Finnish notation (`finnish`)
1+
# Enforce Finnish notation (`rxjs-x/finnish`)
2+
3+
💭 This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).
4+
5+
<!-- end auto-generated rule header -->
26

37
This rule enforces the use of Finnish notation - i.e. the `$` suffix.
48

@@ -18,6 +22,21 @@ const answer$ = of(42, 54);
1822

1923
## Options
2024

25+
<!-- begin auto-generated rule options list -->
26+
27+
| Name | Type |
28+
| :----------- | :------ |
29+
| `functions` | Boolean |
30+
| `methods` | Boolean |
31+
| `names` | Object |
32+
| `parameters` | Boolean |
33+
| `properties` | Boolean |
34+
| `strict` | Boolean |
35+
| `types` | Object |
36+
| `variables` | Boolean |
37+
38+
<!-- end auto-generated rule options list -->
39+
2140
This rule accepts a single option which is an object with properties that determine whether Finnish notation is enforced for `functions`, `methods`, `parameters`, `properties` and `variables`. It also contains:
2241

2342
- `names` and `types` properties that determine whether of not Finnish notation is to be enforced for specific names or types.

docs/rules/just.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Use `just` instead of `of` (`just`)
1+
# Require the use of `just` instead of `of` (`rxjs-x/just`)
22

3-
This rule enforces the use of `just` instead of `of`. Some other languages with Rx implementations use the former and this rule is for developers who have that preference.
3+
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
44

5-
## Options
5+
<!-- end auto-generated rule header -->
66

7-
This rule has no options.
7+
This rule enforces the use of `just` instead of `of`. Some other languages with Rx implementations use the former and this rule is for developers who have that preference.
88

99
## Further reading
1010

11-
- [Rename `of` to `just`](https://github.com/ReactiveX/rxjs/issues/3747)
11+
- [Rename `of` to `just`](https://github.com/ReactiveX/rxjs/issues/3747)

docs/rules/macro.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Use the RxJS Tools macro (`macro`)
1+
# Require the use of the RxJS Tools Babel macro (`rxjs-x/macro`)
22

3-
This rule ensures that modules that import `rxjs` also import the Babel macro for [RxJS Tools](https://rxjs.tools).
3+
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
44

5-
## Options
5+
<!-- end auto-generated rule header -->
66

7-
This rule has no options.
7+
This rule ensures that modules that import `rxjs` also import the Babel macro for [RxJS Tools](https://rxjs.tools).

docs/rules/no-async-subscribe.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# Avoid passing async functions to `subscribe` (`no-async-subscribe`)
1+
# Disallow passing `async` functions to `subscribe` (`rxjs-x/no-async-subscribe`)
2+
3+
💼 This rule is enabled in the ✅ `recommended` config.
4+
5+
💭 This rule requires [type information](https://typescript-eslint.io/linting/typed-linting).
6+
7+
<!-- end auto-generated rule header -->
28

39
This rule effects failures if async functions are passed to `subscribe`.
410

@@ -18,10 +24,6 @@ import { of } from "rxjs";
1824
of(42).subscribe(() => console.log(value));
1925
```
2026

21-
## Options
22-
23-
This rule has no options.
24-
2527
## Further reading
2628

2729
- [Why does this rule exist?](https://stackoverflow.com/q/71559135)

docs/rules/no-compat.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
# Avoid the `rxjs-compat` package (`no-compat`)
1+
# Disallow the `rxjs-compat` package (`rxjs-x/no-compat`)
22

3-
This rule prevents the use of `rxjs-compat`.
3+
<!-- end auto-generated rule header -->
44

5-
## Options
6-
7-
This rule has no options.
5+
This rule prevents importing from locations that depend upon the `rxjs-compat` package.
86

97
## Further reading
108

0 commit comments

Comments
 (0)