Skip to content

Commit

Permalink
📝 tweak document outline
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticatea committed May 3, 2019
1 parent a4fbb9a commit 9243079
Show file tree
Hide file tree
Showing 14 changed files with 59 additions and 59 deletions.
8 changes: 4 additions & 4 deletions docs/rules/exports-style.md
Expand Up @@ -23,7 +23,7 @@ If you use `exports`, this rule disallows `module.exports`.

You can select it by an option.

## Options
### Options

This rule has a string option.

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

### module.exports
#### module.exports

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

Expand All @@ -67,7 +67,7 @@ module.exports = {
module.exports.baz = 3
```

### exports
#### exports

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

Expand All @@ -91,7 +91,7 @@ exports.foo = 1
exports.bar = 2
```

### allowBatchAssign
#### allowBatchAssign

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

Expand Down
10 changes: 5 additions & 5 deletions docs/rules/file-extension-in-import.md
Expand Up @@ -18,7 +18,7 @@ Also, we can import a variety kind of files with bundlers such as Webpack. In th

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

## Options
### Options

This rule has a string option and an object option.

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

### always
#### always

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

Expand All @@ -59,7 +59,7 @@ import eslint from "eslint"
import foo from "./path/to/a/file.js"
```

### never
#### never

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

Expand All @@ -78,7 +78,7 @@ import eslint from "eslint"
import foo from "./path/to/a/file"
```

### .xxx
#### .xxx

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

Expand All @@ -91,7 +91,7 @@ import styles from "./styles.css"
import logo from "./logo.png"
```

## Shared Settings
### Shared Settings

The following options can be set by [shared settings](http://eslint.org/docs/user-guide/configuring.html#adding-shared-settings).
Several rules have the same option, but we can set this option at once.
Expand Down
8 changes: 4 additions & 4 deletions docs/rules/no-deprecated-api.md
Expand Up @@ -144,7 +144,7 @@ This rule reports the following deprecated API.
> For example, `require("punycode")` still imports the deprecated core module even if you executed `npm install punycode`.
> Use `require("punycode/")` to import userland modules rather than core modules.
## Options
### Options

This rule has 2 options.

Expand All @@ -159,7 +159,7 @@ This rule has 2 options.
}
```

### ignoreModuleItems
#### ignoreModuleItems

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

### ignoreGlobalItems
#### ignoreGlobalItems

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

## Known Limitations
## ⚠️ Known Limitations

This rule cannot report the following cases:

Expand Down
10 changes: 5 additions & 5 deletions docs/rules/no-extraneous-import.md
Expand Up @@ -8,7 +8,7 @@ This rule disallows `import` declarations of extraneous modules.

This rule warns `import` declarations of extraneous modules.

## Options
### Options

```json
{
Expand All @@ -22,7 +22,7 @@ This rule warns `import` declarations of extraneous modules.
}
```

### allowModules
#### allowModules

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

### resolvePaths
#### resolvePaths

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

Default is `[]`

### tryExtensions
#### tryExtensions

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

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

## Shared Settings
### Shared Settings

The following options can be set by [shared settings](http://eslint.org/docs/user-guide/configuring.html#adding-shared-settings).
Several rules have the same option, but we can set this option at once.
Expand Down
10 changes: 5 additions & 5 deletions docs/rules/no-extraneous-require.md
Expand Up @@ -10,7 +10,7 @@ This rule disallows `require()` of extraneous modules.

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

## Options
### Options

```json
{
Expand All @@ -24,7 +24,7 @@ This rule warns `require()` of extraneous modules.
}
```

### allowModules
#### allowModules

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

### resolvePaths
#### resolvePaths

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

Default is `[]`

### tryExtensions
#### tryExtensions

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

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

## Shared Settings
### Shared Settings

The following options can be set by [shared settings](http://eslint.org/docs/user-guide/configuring.html#adding-shared-settings).
Several rules have the same option, but we can set this option at once.
Expand Down
8 changes: 4 additions & 4 deletions docs/rules/no-hide-core-modules.md
Expand Up @@ -32,7 +32,7 @@ const util = require("util") // OK if this is the core module 'util' surely.
const path = require("path") // OK if this is the core module 'path' surely.
```

## Options
### Options

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

### allow
#### allow

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.
E.g. `{"allow": ["util", "path"]}`.
Default is en empty array.

### ignoreDirectDependencies
#### ignoreDirectDependencies

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.

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

### ignoreIndirectDependencies
#### ignoreIndirectDependencies

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.

Expand Down
10 changes: 5 additions & 5 deletions docs/rules/no-missing-import.md
Expand Up @@ -28,7 +28,7 @@ import existingFile from "./existing-file";
import existingModule from "existing-module";
```

## Options
### Options

```json
{
Expand All @@ -42,7 +42,7 @@ import existingModule from "existing-module";
}
```

### allowModules
#### allowModules

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

### resolvePaths
#### resolvePaths

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

Default is `[]`

### tryExtensions
#### tryExtensions

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

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

## Shared Settings
### Shared Settings

The following options can be set by [shared settings](http://eslint.org/docs/user-guide/configuring.html#adding-shared-settings).
Several rules have the same option, but we can set this option at once.
Expand Down
10 changes: 5 additions & 5 deletions docs/rules/no-missing-require.md
Expand Up @@ -35,7 +35,7 @@ var existingModule = require("existing-module");
var foo = require(FOO_NAME);
```

## Options
### Options

```json
{
Expand All @@ -49,7 +49,7 @@ var foo = require(FOO_NAME);
}
```

### allowModules
#### allowModules

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

### resolvePaths
#### resolvePaths

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

Default is `[]`

### tryExtensions
#### tryExtensions

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

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

## Shared Settings
### Shared Settings

The following options can be set by [shared settings](http://eslint.org/docs/user-guide/configuring.html#adding-shared-settings).
Several rules have the same option, but we can set this option at once.
Expand Down
6 changes: 3 additions & 3 deletions docs/rules/no-unpublished-bin.md
Expand Up @@ -21,7 +21,7 @@ If `npm` ignores the files in `bin` field, this rule warns the files.
- If `files` field does not includes the files in `bin` field.
- If `.npmignore` file includes the files in `bin` field.

## Options
### Options

```json
{
Expand All @@ -33,7 +33,7 @@ If `npm` ignores the files in `bin` field, this rule warns the files.
}
```

### convertPath
#### convertPath

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


## Shared Settings
### Shared Settings

The following options can be set by [shared settings](http://eslint.org/docs/user-guide/configuring.html#adding-shared-settings).
Several rules have the same option, but we can set this option at once.
Expand Down
10 changes: 5 additions & 5 deletions docs/rules/no-unpublished-import.md
Expand Up @@ -17,7 +17,7 @@ Then this rule warns `import` declarations in \*published\* files if the `import
> This intends to prevent "Module Not Found" error after `npm publish`.<br>
> :bulb: If you want to import `devDependencies`, please write `.npmignore` or `"files"` field of `package.json`.
## Options
### Options

```json
{
Expand All @@ -31,7 +31,7 @@ Then this rule warns `import` declarations in \*published\* files if the `import
}
```

### allowModules
#### allowModules

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

### convertPath
#### convertPath

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

### tryExtensions
#### tryExtensions

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

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

## Shared Settings
### Shared Settings

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

0 comments on commit 9243079

Please sign in to comment.