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

+9
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

+7-7
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

+10
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

+8
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

+7-5
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

+10-3
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

+14
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

+11
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

+10
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

+5-9
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

docs/rules/no-internal-modules.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,14 @@ Use this rule to prevent importing the submodules of other modules.
88

99
This rule has two mutally exclusive options that are arrays of [minimatch/glob patterns](https://github.com/isaacs/node-glob#glob-primer) patterns:
1010

11-
- `allow` that include paths and import statements that can be imported with reaching.
12-
- `forbid` that exclude paths and import statements that can be imported with reaching.
11+
<!-- begin auto-generated rule options list -->
12+
13+
| Name | Description | Type |
14+
| :------- | :---------------------------------------------------------------------- | :------- |
15+
| `allow` | Include paths and import statements that can be imported with reaching. | String[] |
16+
| `forbid` | Exclude paths and import statements that can be imported with reaching. | String[] |
17+
18+
<!-- end auto-generated rule options list -->
1319

1420
### Examples
1521

docs/rules/no-namespace.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ The rule is auto-fixable when the namespace object is only used for direct membe
1010

1111
## Options
1212

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

15-
- `ignore`: array of glob strings for modules that should be ignored by the rule.
15+
| Name | Description | Type |
16+
| :------- | :----------------------------------------------------------- | :------- |
17+
| `ignore` | Glob strings for modules that should be ignored by the rule. | String[] |
18+
19+
<!-- end auto-generated rule options list -->
1620

1721
## Rule Details
1822

docs/rules/no-nodejs-modules.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ Forbid the use of Node.js builtin modules. Can be useful for client-side web pro
66

77
## Options
88

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

11-
- `allow`: Array of names of allowed modules. Defaults to an empty array.
11+
| Name | Description | Type |
12+
| :------ | :------------------------ | :------- |
13+
| `allow` | Names of allowed modules. | String[] |
14+
15+
<!-- end auto-generated rule options list -->
1216

1317
## Rule Details
1418

docs/rules/no-relative-packages.md

+13
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,16 @@ import bar from 'bar'; // Import sibling package using package name
6868

6969
import bar from 'bar'; // Import sibling package using package name
7070
```
71+
72+
## Options
73+
74+
<!-- begin auto-generated rule options list -->
75+
76+
| Name | Type | Default |
77+
| :--------- | :------- | :------ |
78+
| `amd` | Boolean | `false` |
79+
| `commonjs` | Boolean | `true` |
80+
| `esmodule` | Boolean | `true` |
81+
| `ignore` | String[] | |
82+
83+
<!-- end auto-generated rule options list -->

docs/rules/no-relative-parent-imports.md

+13
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,16 @@ import a from './lib/a'; // Import child file using relative path
121121

122122
import b from './b'; // Import sibling file using relative path
123123
```
124+
125+
## Options
126+
127+
<!-- begin auto-generated rule options list -->
128+
129+
| Name | Type | Default |
130+
| :--------- | :------- | :------ |
131+
| `amd` | Boolean | `false` |
132+
| `commonjs` | Boolean | `true` |
133+
| `esmodule` | Boolean | `true` |
134+
| `ignore` | String[] | |
135+
136+
<!-- end auto-generated rule options list -->

docs/rules/no-unassigned-import.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@ This rule aims to remove modules with side-effects by reporting when a module is
1111

1212
## Options
1313

14-
This rule supports the following option:
14+
<!-- begin auto-generated rule options list -->
1515

16-
`allow`: An Array of globs. The files that match any of these patterns would be ignored/allowed by the linter. This can be useful for some build environments (e.g. css-loader in webpack).
16+
| Name | Description | Type |
17+
| :--------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------ |
18+
| `allow` | An Array of globs. The files that match any of these patterns would be ignored/allowed by the linter. This can be useful for some build environments (e.g. css-loader in webpack). Note that the globs start from the where the linter is executed (usually project root), but not from each file that includes the source. Learn more in both the pass and fail examples below. | String[] |
19+
| `devDependencies` | | Boolean,array |
20+
| `optionalDependencies` | | Boolean,array |
21+
| `peerDependencies` | | Boolean,array |
1722

18-
Note that the globs start from the where the linter is executed (usually project root), but not from each file that includes the source. Learn more in both the pass and fail examples below.
23+
<!-- end auto-generated rule options list -->
1924

2025
## Fail
2126

docs/rules/no-unresolved.md

+13
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@ If you are using Webpack, see the section on [resolvers](../../README.md#resolve
2121

2222
### Options
2323

24+
<!-- begin auto-generated rule options list -->
25+
26+
| Name | Type | Default |
27+
| :-------------------- | :------- | :------ |
28+
| `amd` | Boolean | `false` |
29+
| `caseSensitive` | Boolean | `true` |
30+
| `caseSensitiveStrict` | Boolean | `false` |
31+
| `commonjs` | Boolean | `true` |
32+
| `esmodule` | Boolean | `true` |
33+
| `ignore` | String[] | |
34+
35+
<!-- end auto-generated rule options list -->
36+
2437
By default, only ES6 imports will be resolved:
2538

2639
```js

docs/rules/no-unused-modules.md

+13-6
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,19 @@ Example:
2525

2626
### Options
2727

28-
This rule takes the following option:
29-
30-
- **`missingExports`**: if `true`, files without any exports are reported (defaults to `false`)
31-
- **`unusedExports`**: if `true`, exports without any static usage within other modules are reported (defaults to `false`)
32-
- `src`: an array with files/paths to be analyzed. It only applies to unused exports. Defaults to `process.cwd()`, if not provided
33-
- `ignoreExports`: an array with files/paths for which unused exports will not be reported (e.g module entry points in a published package)
28+
<!-- begin auto-generated rule options list -->
29+
30+
| Name | Description | Type | Choices | Default | Required |
31+
| :--------------- | :--------------------------------------------------------------------------------------------------------- | :------- | :------ | :-------------- | :------- |
32+
| `ignoreExports` | files/paths for which unused exports will not be reported (e.g module entry points in a published package) | String[] | | | |
33+
| `missingExports` | report modules without any exports | Boolean | | `false` | |
34+
| `missingExports` | | | `true` | | Yes |
35+
| `src` | files/paths to be analyzed (only for unused exports) | String[] | | `process.cwd()` | |
36+
| `src` | | | | | |
37+
| `unusedExports` | report exports without any usage | Boolean | | `false` | |
38+
| `unusedExports` | | | `true` | | Yes |
39+
40+
<!-- end auto-generated rule options list -->
3441

3542
### Example for missing exports
3643

docs/rules/no-useless-path-segments.md

+9
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ import fs from "fs";
5959

6060
## Options
6161

62+
<!-- begin auto-generated rule options list -->
63+
64+
| Name | Type |
65+
| :--------------- | :------ |
66+
| `commonjs` | Boolean |
67+
| `noUselessIndex` | Boolean |
68+
69+
<!-- end auto-generated rule options list -->
70+
6271
### noUselessIndex
6372

6473
If you want to detect unnecessary `/index` or `/index.js` (depending on the specified file extensions, see below) imports in your paths, you can enable the option `noUselessIndex`. By default it is set to `false`:

0 commit comments

Comments
 (0)