Skip to content

Commit 4c019c7

Browse files
committed
docs: autogenerate many rule options list with eslint-doc-generator
1 parent 6d34c88 commit 4c019c7

33 files changed

+209
-87
lines changed

docs/rules/dynamic-import-chunkname.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ This rule enforces naming of webpack chunks in dynamic imports. When you don't e
1111
This rule runs against `import()` by default, but can be configured to also run against an alternative dynamic-import function, e.g. 'dynamicImport.'
1212
You can also configure the regex format you'd like to accept for the webpackChunkName - for example, if we don't want the number 6 to show up in our chunk names:
1313

14+
<!-- begin auto-generated rule options list -->
15+
16+
| Name | Type |
17+
| :----------------------- | :------- |
18+
| `importFunctions` | String[] |
19+
| `webpackChunknameFormat` | String |
20+
21+
<!-- end auto-generated rule options list -->
22+
1423
```javascript
1524
{
1625
"dynamic-import-chunkname": [2, {

docs/rules/max-dependencies.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ Importing multiple named exports from a single module will only count once (e.g.
1010

1111
## Options
1212

13-
This rule has the following options, with these defaults:
13+
<!-- begin auto-generated rule options list -->
1414

15-
```js
16-
"import/max-dependencies": ["error", {
17-
"max": 10,
18-
"ignoreTypeImports": false,
19-
}]
20-
```
15+
| Name | Type | Default |
16+
| :------------------ | :------ | :------ |
17+
| `ignoreTypeImports` | Boolean | `false` |
18+
| `max` | Number | `10` |
19+
20+
<!-- end auto-generated rule options list -->
2121

2222
### `max`
2323

docs/rules/named.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@ then the following is not reported:
8686
import { notWhatever } from './whatever'
8787
```
8888

89+
## Options
90+
91+
<!-- begin auto-generated rule options list -->
92+
93+
| Name | Type | Default |
94+
| :--------- | :------ | :------ |
95+
| `commonjs` | Boolean | `false` |
96+
97+
<!-- end auto-generated rule options list -->
98+
8999
## When Not To Use It
90100

91101
If you are using CommonJS and/or modifying the exported namespace of any module at

docs/rules/namespace.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ function deepTrouble() {
7979

8080
### Options
8181

82+
<!-- begin auto-generated rule options list -->
83+
84+
| Name | Description | Type | Default |
85+
| :-------------- | :---------------------------------------------------------------------------------------- | :------ | :------ |
86+
| `allowComputed` | If `false`, will report computed (and thus, un-lintable) references to namespace members. | Boolean | `false` |
87+
88+
<!-- end auto-generated rule options list -->
89+
8290
#### `allowComputed`
8391

8492
Defaults to `false`. When false, will report the following:

docs/rules/newline-after-import.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ Enforces having one or more empty lines after the last top-level import statemen
88

99
## Rule Details
1010

11-
This rule supports the following options:
11+
<!-- begin auto-generated rule options list -->
1212

13-
- `count` which sets the number of newlines that are enforced after the last top-level import statement or require call. This option defaults to `1`.
13+
| Name | Description | Type | Default |
14+
| :----------------- | :------------------------------------------------------------------------------------------------------- | :------ | :------ |
15+
| `considerComments` | enforces the rule on comments after the last import-statement as well when set to true | Boolean | `false` |
16+
| `count` | Sets the number of newlines that are enforced after the last top-level import statement or require call. | Integer | |
17+
| `exactCount` | enforce the exact numbers of newlines that is mentioned in `count` | Boolean | `false` |
1418

15-
- `exactCount` which enforce the exact numbers of newlines that is mentioned in `count`. This option defaults to `false`.
16-
17-
- `considerComments` which enforces the rule on comments after the last import-statement as well when set to true. This option defaults to `false`.
19+
<!-- end auto-generated rule options list -->
1820

1921
Valid:
2022

docs/rules/no-absolute-path.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,16 @@ By default, only ES6 imports and CommonJS `require` calls will have this rule en
3838

3939
You may provide an options object providing true/false for any of
4040

41-
- `esmodule`: defaults to `true`
42-
- `commonjs`: defaults to `true`
43-
- `amd`: defaults to `false`
41+
<!-- begin auto-generated rule options list -->
42+
43+
| Name | Type | Default |
44+
| :--------- | :------- | :------ |
45+
| `amd` | Boolean | `false` |
46+
| `commonjs` | Boolean | `true` |
47+
| `esmodule` | Boolean | `true` |
48+
| `ignore` | String[] | |
49+
50+
<!-- end auto-generated rule options list -->
4451

4552
If `{ amd: true }` is provided, dependency paths for AMD-style `define` and `require`
4653
calls will be resolved:

docs/rules/no-cycle.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,20 @@ This rule ignores type-only imports in Flow and TypeScript syntax (`import type`
2828

2929
### Options
3030

31+
<!-- begin auto-generated rule options list -->
32+
33+
| Name | Description | Type | Default |
34+
| :----------------------------------- | :--------------------------------------------------------------------------- | :------- | :------ |
35+
| `allowUnsafeDynamicCyclicDependency` | Allow cyclic dependency if there is at least one dynamic import in the chain | Boolean | `false` |
36+
| `amd` | | Boolean | `false` |
37+
| `commonjs` | | Boolean | `true` |
38+
| `esmodule` | | Boolean | `true` |
39+
| `ignore` | | String[] | |
40+
| `ignoreExternal` | ignore external modules | Boolean | `false` |
41+
| `maxDepth` | | | |
42+
43+
<!-- end auto-generated rule options list -->
44+
3145
By default, this rule only detects cycles for ES6 imports, but see the [`no-unresolved` options](./no-unresolved.md#options) as this rule also supports the same `commonjs` and `amd` flags. However, these flags only impact which import types are _linted_; the
3246
import/export infrastructure only registers `import` statements in dependencies, so
3347
cycles created by `require` within imported modules may not be detected.

docs/rules/no-duplicates.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@ The motivation is that this is likely a result of two developers importing diffe
4242
names from the same module at different times (and potentially largely different
4343
locations in the file.) This rule brings both (or n-many) to attention.
4444

45+
## Options
46+
47+
<!-- begin auto-generated rule options list -->
48+
49+
| Name | Type | Default |
50+
| :-------------------- | :------ | :------ |
51+
| `considerQueryString` | Boolean | `false` |
52+
| `prefer-inline` | Boolean | `false` |
53+
54+
<!-- end auto-generated rule options list -->
55+
4556
### Query Strings
4657

4758
By default, this rule ignores query strings (i.e. paths followed by a question mark), and thus imports from `./mod?a` and `./mod?b` will be considered as duplicates. However you can use the option `considerQueryString` to handle them as different (primarily because browsers will resolve those imports differently).

docs/rules/no-dynamic-require.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,13 @@ require(name());
2323
require('../name');
2424
require(`../name`);
2525
```
26+
27+
## Options
28+
29+
<!-- begin auto-generated rule options list -->
30+
31+
| Name | Type | Default |
32+
| :--------- | :------ | :------ |
33+
| `esmodule` | Boolean | `false` |
34+
35+
<!-- end auto-generated rule options list -->

docs/rules/no-import-module-exports.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,13 @@ If you have multiple entry points or are using `js:next` this rule includes an
1212

1313
## Options
1414

15-
### `exceptions`
15+
<!-- begin auto-generated rule options list -->
1616

17-
- An array of globs. The rule will be omitted from any file that matches a glob
18-
in the options array. For example, the following setting will omit the rule
19-
in the `some-file.js` file.
17+
| Name | Description | Type |
18+
| :----------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :---- |
19+
| `exceptions` | An array of globs. The rule will be omitted from any file that matches a glob in the options array. For example, `"**/*/some-file.js"` will omit the rule in the `some-file.js` file. | Array |
2020

21-
```json
22-
"import/no-import-module-exports": ["error", {
23-
"exceptions": ["**/*/some-file.js"]
24-
}]
25-
```
21+
<!-- end auto-generated rule options list -->
2622

2723
## Rule Details
2824

0 commit comments

Comments
 (0)