Skip to content

Commit ee705d2

Browse files
docs: add meta.schema descriptions to rule options (#6)
- Add eslint-plugin-eslint-plugin. - Add programmatic documentation on the options of each rule and auto-generate the documentation from them. - Enforce with `eslint-plugin/require-meta-schema-description`.
1 parent 00a6e93 commit ee705d2

25 files changed

+133
-100
lines changed

docs/rules/finnish.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,22 @@ const answer$ = of(42, 54);
2424

2525
<!-- begin auto-generated rule options list -->
2626

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 |
27+
| Name | Description | Type |
28+
| :----------- | :------------------------------------------------------------------- | :------ |
29+
| `functions` | Require for functions. | Boolean |
30+
| `methods` | Require for methods. | Boolean |
31+
| `names` | Enforce for specific names. Keys are a RegExp, values are a boolean. | Object |
32+
| `parameters` | Require for parameters. | Boolean |
33+
| `properties` | Require for properties. | Boolean |
34+
| `strict` | Disallow Finnish notation for non-Observables. | Boolean |
35+
| `types` | Enforce for specific types. Keys are a RegExp, values are a boolean. | Object |
36+
| `variables` | Require for variables. | Boolean |
3737

3838
<!-- end auto-generated rule options list -->
3939

4040
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:
4141

42-
- `names` and `types` properties that determine whether of not Finnish notation is to be enforced for specific names or types.
42+
- `names` and `types` properties that determine whether or not Finnish notation is to be enforced for specific names or types.
4343
- a `strict` property that, if `true`, allows the `$` suffix to be used _only_ with identifiers that have an `Observable` type.
4444

4545
The default (Angular-friendly) configuration looks like this:

docs/rules/no-cyclic-action.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ Or you can use an ESLint [inline comment](https://eslint.org/docs/user-guide/con
5656

5757
<!-- begin auto-generated rule options list -->
5858

59-
| Name | Type |
60-
| :----------- | :----- |
61-
| `observable` | String |
59+
| Name | Description | Type | Default |
60+
| :----------- | :------------------------------------------------------------ | :----- | :----------------------- |
61+
| `observable` | A RegExp that matches an effect or epic's actions observable. | String | `[Aa]ction(s\|s\$\|\$)$` |
6262

6363
<!-- end auto-generated rule options list -->
6464

docs/rules/no-exposed-subjects.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ class Answers {
3333

3434
<!-- begin auto-generated rule options list -->
3535

36-
| Name | Type |
37-
| :--------------- | :------ |
38-
| `allowProtected` | Boolean |
36+
| Name | Description | Type | Default |
37+
| :--------------- | :------------------------ | :------ | :------ |
38+
| `allowProtected` | Allow protected subjects. | Boolean | `false` |
3939

4040
<!-- end auto-generated rule options list -->
4141

docs/rules/no-implicit-any-catch.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ throwError(() => new Error("Kaboom!")).pipe(
7272

7373
<!-- begin auto-generated rule options list -->
7474

75-
| Name | Type |
76-
| :----------------- | :------ |
77-
| `allowExplicitAny` | Boolean |
75+
| Name | Description | Type | Default |
76+
| :----------------- | :---------------------------------------------------- | :------ | :------ |
77+
| `allowExplicitAny` | Allow error variable to be explicitly typed as `any`. | Boolean | `false` |
7878

7979
<!-- end auto-generated rule options list -->
8080

docs/rules/no-sharereplay.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ The behavior of `shareReplay` has changed several times - see the blog post link
1212

1313
<!-- begin auto-generated rule options list -->
1414

15-
| Name | Type |
16-
| :------------ | :------ |
17-
| `allowConfig` | Boolean |
15+
| Name | Description | Type | Default |
16+
| :------------ | :--------------------------------------------------- | :------ | :------ |
17+
| `allowConfig` | Allow shareReplay if a config argument is specified. | Boolean | `true` |
1818

1919
<!-- end auto-generated rule options list -->
2020

docs/rules/no-unsafe-catch.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ actions.pipe(
4444

4545
<!-- begin auto-generated rule options list -->
4646

47-
| Name | Type |
48-
| :----------- | :----- |
49-
| `observable` | String |
47+
| Name | Description | Type | Default |
48+
| :----------- | :------------------------------------------------------------ | :----- | :----------------------- |
49+
| `observable` | A RegExp that matches an effect or epic's actions observable. | String | `[Aa]ction(s\|s\$\|\$)$` |
5050

5151
<!-- end auto-generated rule options list -->
5252

docs/rules/no-unsafe-first.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ This rule effects failures if `first` is used in an effect or epic in a manner t
1010

1111
<!-- begin auto-generated rule options list -->
1212

13-
| Name | Type |
14-
| :----------- | :----- |
15-
| `observable` | String |
13+
| Name | Description | Type | Default |
14+
| :----------- | :------------------------------------------------------------ | :----- | :----------------------- |
15+
| `observable` | A RegExp that matches an effect or epic's actions observable. | String | `[Aa]ction(s\|s\$\|\$)$` |
1616

1717
<!-- end auto-generated rule options list -->
1818

docs/rules/no-unsafe-switchmap.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ This rule effects failures if `switchMap` is used in effects or epics that perfo
1010

1111
<!-- begin auto-generated rule options list -->
1212

13-
| Name |
14-
| :----------- |
15-
| `allow` |
16-
| `disallow` |
17-
| `observable` |
13+
| Name | Description | Type | Default |
14+
| :----------- | :------------------------------------------------------------------------------------------- | :----- | :----------------------- |
15+
| `allow` | Action types that are allowed to be used with switchMap. Mutually exclusive with `disallow`. | | |
16+
| `disallow` | Action types that are disallowed to be used with switchMap. Mutually exclusive with `allow`. | | |
17+
| `observable` | A RegExp that matches an effect or epic's actions observable. | String | `[Aa]ction(s\|s\$\|\$)$` |
1818

1919
<!-- end auto-generated rule options list -->
2020

docs/rules/no-unsafe-takeuntil.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ const combined = source
3232

3333
<!-- begin auto-generated rule options list -->
3434

35-
| Name | Type |
36-
| :------ | :------- |
37-
| `alias` | String[] |
38-
| `allow` | String[] |
35+
| Name | Description | Type | Default |
36+
| :------ | :-------------------------------------------------------------------------- | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
37+
| `alias` | An array of operator names that should be treated similarly to `takeUntil`. | String[] | |
38+
| `allow` | An array of operator names that are allowed to follow `takeUntil`. | String[] | [`count`, `defaultIfEmpty`, `endWith`, `every`, `finalize`, `finally`, `isEmpty`, `last`, `max`, `min`, `publish`, `publishBehavior`, `publishLast`, `publishReplay`, `reduce`, `share`, `shareReplay`, `skipLast`, `takeLast`, `throwIfEmpty`, `toArray`] |
3939

4040
<!-- end auto-generated rule options list -->
4141

docs/rules/prefer-observer.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ of(42, 54).subscribe({
3030

3131
<!-- begin auto-generated rule options list -->
3232

33-
| Name | Type |
34-
| :---------- | :------ |
35-
| `allowNext` | Boolean |
33+
| Name | Description | Type | Default |
34+
| :---------- | :------------------------------- | :------ | :------ |
35+
| `allowNext` | Allows a single `next` callback. | Boolean | `true` |
3636

3737
<!-- end auto-generated rule options list -->
3838

0 commit comments

Comments
 (0)