Skip to content

Commit 9243079

Browse files
committed
📝 tweak document outline
1 parent a4fbb9a commit 9243079

14 files changed

+59
-59
lines changed

docs/rules/exports-style.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ If you use `exports`, this rule disallows `module.exports`.
2323

2424
You can select it by an option.
2525

26-
## Options
26+
### Options
2727

2828
This rule has a string option.
2929

@@ -43,7 +43,7 @@ This rule has a string option.
4343
- `"exports"` requires `exports` and disallows `module.exports`.
4444
- `allowBatchAssign` (default is `false`) allows `module.exports = exports = obj` if this is `true`.
4545

46-
### module.exports
46+
#### module.exports
4747

4848
Examples of :-1: **incorrect** code for the `"module.exports"` option:
4949

@@ -67,7 +67,7 @@ module.exports = {
6767
module.exports.baz = 3
6868
```
6969

70-
### exports
70+
#### exports
7171

7272
Examples of :-1: **incorrect** code for the `"exports"` option:
7373

@@ -91,7 +91,7 @@ exports.foo = 1
9191
exports.bar = 2
9292
```
9393

94-
### allowBatchAssign
94+
#### allowBatchAssign
9595

9696
Examples of :+1: **correct** code for the `"exports"` and `{"allowBatchAssign": true}` option:
9797

docs/rules/file-extension-in-import.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Also, we can import a variety kind of files with bundlers such as Webpack. In th
1818

1919
This rule enforces the style of file extensions in `import`/`export` declarations.
2020

21-
## Options
21+
### Options
2222

2323
This rule has a string option and an object option.
2424

@@ -40,7 +40,7 @@ This rule has a string option and an object option.
4040
- `tryExtensions` is the file extensions to resolve import paths. Default is `[".js", ".json", ".node"]`.
4141
- `.xxx` is the overriding setting for specific file extensions. You can use arbitrary property names which start with `.`.
4242

43-
### always
43+
#### always
4444

4545
Examples of :-1: **incorrect** code for the `"always"` option:
4646

@@ -59,7 +59,7 @@ import eslint from "eslint"
5959
import foo from "./path/to/a/file.js"
6060
```
6161

62-
### never
62+
#### never
6363

6464
Examples of :-1: **incorrect** code for the `"never"` option:
6565

@@ -78,7 +78,7 @@ import eslint from "eslint"
7878
import foo from "./path/to/a/file"
7979
```
8080

81-
### .xxx
81+
#### .xxx
8282

8383
Examples of :+1: **correct** code for the `["always", { ".js": "never" }]` option:
8484

@@ -91,7 +91,7 @@ import styles from "./styles.css"
9191
import logo from "./logo.png"
9292
```
9393

94-
## Shared Settings
94+
### Shared Settings
9595

9696
The following options can be set by [shared settings](http://eslint.org/docs/user-guide/configuring.html#adding-shared-settings).
9797
Several rules have the same option, but we can set this option at once.

docs/rules/no-deprecated-api.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ This rule reports the following deprecated API.
144144
> For example, `require("punycode")` still imports the deprecated core module even if you executed `npm install punycode`.
145145
> Use `require("punycode/")` to import userland modules rather than core modules.
146146
147-
## Options
147+
### Options
148148

149149
This rule has 2 options.
150150

@@ -159,7 +159,7 @@ This rule has 2 options.
159159
}
160160
```
161161

162-
### ignoreModuleItems
162+
#### ignoreModuleItems
163163

164164
This is the array of module names and module's member names.
165165
Default is an empty array.
@@ -262,7 +262,7 @@ const buffer = require("buffer")
262262
const data = new buffer.Buffer(10) // OK since it's in ignoreModuleItems.
263263
```
264264

265-
### ignoreGlobalItems
265+
#### ignoreGlobalItems
266266

267267
This is the array of global variable names and global variable's member names.
268268
Default is an empty array.
@@ -293,7 +293,7 @@ Examples of :+1: **correct** code for the `{"ignoreGlobalItems": ["new Buffer()"
293293
const data = new Buffer(10) // OK since it's in ignoreGlobalItems.
294294
```
295295

296-
## Known Limitations
296+
## ⚠️ Known Limitations
297297

298298
This rule cannot report the following cases:
299299

docs/rules/no-extraneous-import.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This rule disallows `import` declarations of extraneous modules.
88

99
This rule warns `import` declarations of extraneous modules.
1010

11-
## Options
11+
### Options
1212

1313
```json
1414
{
@@ -22,7 +22,7 @@ This rule warns `import` declarations of extraneous modules.
2222
}
2323
```
2424

25-
### allowModules
25+
#### allowModules
2626

2727
Some platforms have additional embedded modules.
2828
For example, Electron has `electron` module.
@@ -40,21 +40,21 @@ This option is an array of strings as module names.
4040
}
4141
```
4242

43-
### resolvePaths
43+
#### resolvePaths
4444

4545
Adds additional paths to try for when resolving imports.
4646
If a path is relative, it will be resolved from CWD.
4747

4848
Default is `[]`
4949

50-
### tryExtensions
50+
#### tryExtensions
5151

5252
When an import path does not exist, this rule checks whether or not any of `path.js`, `path.json`, and `path.node` exists.
5353
`tryExtensions` option is the extension list this rule uses at the time.
5454

5555
Default is `[".js", ".json", ".node"]`.
5656

57-
## Shared Settings
57+
### Shared Settings
5858

5959
The following options can be set by [shared settings](http://eslint.org/docs/user-guide/configuring.html#adding-shared-settings).
6060
Several rules have the same option, but we can set this option at once.

docs/rules/no-extraneous-require.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This rule disallows `require()` of extraneous modules.
1010

1111
This rule warns `require()` of extraneous modules.
1212

13-
## Options
13+
### Options
1414

1515
```json
1616
{
@@ -24,7 +24,7 @@ This rule warns `require()` of extraneous modules.
2424
}
2525
```
2626

27-
### allowModules
27+
#### allowModules
2828

2929
Some platforms have additional embedded modules.
3030
For example, Electron has `electron` module.
@@ -42,21 +42,21 @@ This option is an array of strings as module names.
4242
}
4343
```
4444

45-
### resolvePaths
45+
#### resolvePaths
4646

4747
Adds additional paths to try for when resolving imports.
4848
If a path is relative, it will be resolved from CWD.
4949

5050
Default is `[]`
5151

52-
### tryExtensions
52+
#### tryExtensions
5353

5454
When an import path does not exist, this rule checks whether or not any of `path.js`, `path.json`, and `path.node` exists.
5555
`tryExtensions` option is the extension list this rule uses at the time.
5656

5757
Default is `[".js", ".json", ".node"]`.
5858

59-
## Shared Settings
59+
### Shared Settings
6060

6161
The following options can be set by [shared settings](http://eslint.org/docs/user-guide/configuring.html#adding-shared-settings).
6262
Several rules have the same option, but we can set this option at once.

docs/rules/no-hide-core-modules.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const util = require("util") // OK if this is the core module 'util' surely.
3232
const path = require("path") // OK if this is the core module 'path' surely.
3333
```
3434

35-
## Options
35+
### Options
3636

3737
```json
3838
{
@@ -44,19 +44,19 @@ const path = require("path") // OK if this is the core module 'path' surely.
4444
}
4545
```
4646

47-
### allow
47+
#### allow
4848

4949
If you are sure that your module depends on the third-party module which has the same name as a core module, you can allow it by `allow` option.
5050
E.g. `{"allow": ["util", "path"]}`.
5151
Default is en empty array.
5252

53-
### ignoreDirectDependencies
53+
#### ignoreDirectDependencies
5454

5555
If `ignoreDirectDependencies: true`, if the third-party module which has the same name as a core module exists in your `package.json`, this rule ignores it.
5656

5757
This option would allow all explicit dependencies which are hiding core modules.
5858

59-
### ignoreIndirectDependencies
59+
#### ignoreIndirectDependencies
6060

6161
If `ignoreIndirectDependencies: true`, if the third-party module which has the same name as a core module does not exist in your `package.json`, this rule ignores it.
6262

docs/rules/no-missing-import.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import existingFile from "./existing-file";
2828
import existingModule from "existing-module";
2929
```
3030

31-
## Options
31+
### Options
3232

3333
```json
3434
{
@@ -42,7 +42,7 @@ import existingModule from "existing-module";
4242
}
4343
```
4444

45-
### allowModules
45+
#### allowModules
4646

4747
Some platforms have additional embedded modules.
4848
For example, Electron has `electron` module.
@@ -60,21 +60,21 @@ This option is an array of strings as module names.
6060
}
6161
```
6262

63-
### resolvePaths
63+
#### resolvePaths
6464

6565
Adds additional paths to try for when resolving imports.
6666
If a path is relative, it will be resolved from CWD.
6767

6868
Default is `[]`
6969

70-
### tryExtensions
70+
#### tryExtensions
7171

7272
When an import path does not exist, this rule checks whether or not any of `path.js`, `path.json`, and `path.node` exists.
7373
`tryExtensions` option is the extension list this rule uses at the time.
7474

7575
Default is `[".js", ".json", ".node"]`.
7676

77-
## Shared Settings
77+
### Shared Settings
7878

7979
The following options can be set by [shared settings](http://eslint.org/docs/user-guide/configuring.html#adding-shared-settings).
8080
Several rules have the same option, but we can set this option at once.

docs/rules/no-missing-require.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var existingModule = require("existing-module");
3535
var foo = require(FOO_NAME);
3636
```
3737

38-
## Options
38+
### Options
3939

4040
```json
4141
{
@@ -49,7 +49,7 @@ var foo = require(FOO_NAME);
4949
}
5050
```
5151

52-
### allowModules
52+
#### allowModules
5353

5454
Some platforms have additional embedded modules.
5555
For example, Electron has `electron` module.
@@ -67,21 +67,21 @@ This option is an array of strings as module names.
6767
}
6868
```
6969

70-
### resolvePaths
70+
#### resolvePaths
7171

7272
Adds additional paths to try for when resolving a require.
7373
If a path is relative, it will be resolved from CWD.
7474

7575
Default is `[]`
7676

77-
### tryExtensions
77+
#### tryExtensions
7878

7979
When an import path does not exist, this rule checks whether or not any of `path.js`, `path.json`, and `path.node` exists.
8080
`tryExtensions` option is the extension list this rule uses at the time.
8181

8282
Default is `[".js", ".json", ".node"]`.
8383

84-
## Shared Settings
84+
### Shared Settings
8585

8686
The following options can be set by [shared settings](http://eslint.org/docs/user-guide/configuring.html#adding-shared-settings).
8787
Several rules have the same option, but we can set this option at once.

docs/rules/no-unpublished-bin.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ If `npm` ignores the files in `bin` field, this rule warns the files.
2121
- If `files` field does not includes the files in `bin` field.
2222
- If `.npmignore` file includes the files in `bin` field.
2323

24-
## Options
24+
### Options
2525

2626
```json
2727
{
@@ -33,7 +33,7 @@ If `npm` ignores the files in `bin` field, this rule warns the files.
3333
}
3434
```
3535

36-
### convertPath
36+
#### convertPath
3737

3838
If we use transpilers (e.g. Babel), perhaps the file path to a source code is never published.
3939
`convertPath` option tells to the rule, it needs to convert file paths.
@@ -87,7 +87,7 @@ In this style, this option has the following shape as the same expression as abo
8787
In addition, we can specify glob patterns to exclude files.
8888

8989

90-
## Shared Settings
90+
### Shared Settings
9191

9292
The following options can be set by [shared settings](http://eslint.org/docs/user-guide/configuring.html#adding-shared-settings).
9393
Several rules have the same option, but we can set this option at once.

docs/rules/no-unpublished-import.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Then this rule warns `import` declarations in \*published\* files if the `import
1717
> This intends to prevent "Module Not Found" error after `npm publish`.<br>
1818
> :bulb: If you want to import `devDependencies`, please write `.npmignore` or `"files"` field of `package.json`.
1919
20-
## Options
20+
### Options
2121

2222
```json
2323
{
@@ -31,7 +31,7 @@ Then this rule warns `import` declarations in \*published\* files if the `import
3131
}
3232
```
3333

34-
### allowModules
34+
#### allowModules
3535

3636
Some platforms have additional embedded modules.
3737
For example, Electron has `electron` module.
@@ -49,7 +49,7 @@ This option is an array of strings as module names.
4949
}
5050
```
5151

52-
### convertPath
52+
#### convertPath
5353

5454
If we use transpilers (e.g. Babel), perhaps the file path to a source code is never published.
5555
`convertPath` option tells to the rule, it needs to convert file paths.
@@ -103,14 +103,14 @@ For example:
103103
In this style, this option has the following shape as the same expression as above: `{include: [<targetFiles>], replace: [<fromRegExp>, <toString>]}`.
104104
In addition, we can specify glob patterns to exclude files.
105105

106-
### tryExtensions
106+
#### tryExtensions
107107

108108
When an import path does not exist, this rule checks whether or not any of `path.js`, `path.json`, and `path.node` exists.
109109
`tryExtensions` option is the extension list this rule uses at the time.
110110

111111
Default is `[".js", ".json", ".node"]`.
112112

113-
## Shared Settings
113+
### Shared Settings
114114

115115
The following options can be set by [shared settings](http://eslint.org/docs/user-guide/configuring.html#adding-shared-settings).
116116
Several rules have the same option, but we can set this option at once.

0 commit comments

Comments
 (0)