Update checked-in dependencies
This commit is contained in:
parent
6b0d45a5c6
commit
cc1adb825a
4247 changed files with 144820 additions and 149530 deletions
36
node_modules/eslint-plugin-import/docs/rules/order.md
generated
vendored
36
node_modules/eslint-plugin-import/docs/rules/order.md
generated
vendored
|
|
@ -2,7 +2,8 @@
|
|||
|
||||
Enforce a convention in the order of `require()` / `import` statements.
|
||||
+(fixable) The `--fix` option on the [command line] automatically fixes problems reported by this rule.
|
||||
The order is as shown in the following example:
|
||||
|
||||
With the [`groups`](#groups-array) option set to `["builtin", "external", "internal", "parent", "sibling", "index", "object"]` the order is as shown in the following example:
|
||||
|
||||
```js
|
||||
// 1. node "builtin" modules
|
||||
|
|
@ -24,6 +25,8 @@ import baz from './bar/baz';
|
|||
import main from './';
|
||||
// 7. "object"-imports (only available in TypeScript)
|
||||
import log = console.log;
|
||||
// 8. "type" imports (only available in Flow and TypeScript)
|
||||
import type { Foo } from 'foo';
|
||||
```
|
||||
|
||||
Unassigned imports are ignored, as the order they are imported in may be important.
|
||||
|
|
@ -80,7 +83,7 @@ This rule supports the following options:
|
|||
### `groups: [array]`:
|
||||
|
||||
How groups are defined, and the order to respect. `groups` must be an array of `string` or [`string`]. The only allowed `string`s are:
|
||||
`"builtin"`, `"external"`, `"internal"`, `"unknown"`, `"parent"`, `"sibling"`, `"index"`, `"object"`.
|
||||
`"builtin"`, `"external"`, `"internal"`, `"unknown"`, `"parent"`, `"sibling"`, `"index"`, `"object"`, `"type"`.
|
||||
The enforced order is the same as the order of each element in a group. Omitted types are implicitly grouped together as the last element. Example:
|
||||
```js
|
||||
[
|
||||
|
|
@ -96,7 +99,7 @@ The default value is `["builtin", "external", "parent", "sibling", "index"]`.
|
|||
You can set the options like this:
|
||||
|
||||
```js
|
||||
"import/order": ["error", {"groups": ["index", "sibling", "parent", "internal", "external", "builtin", "object"]}]
|
||||
"import/order": ["error", {"groups": ["index", "sibling", "parent", "internal", "external", "builtin", "object", "type"]}]
|
||||
```
|
||||
|
||||
### `pathGroups: [array of objects]`:
|
||||
|
|
@ -253,6 +256,33 @@ import React, { PureComponent } from 'react';
|
|||
import { compose, apply } from 'xcompose';
|
||||
```
|
||||
|
||||
### `warnOnUnassignedImports: true|false`:
|
||||
|
||||
* default: `false`
|
||||
|
||||
Warns when unassigned imports are out of order. These warning will not be fixed
|
||||
with `--fix` because unassigned imports are used for side-effects and changing the
|
||||
import of order of modules with side effects can not be done automatically in a
|
||||
way that is safe.
|
||||
|
||||
This will fail the rule check:
|
||||
|
||||
```js
|
||||
/* eslint import/order: ["error", {"warnOnUnassignedImports": true}] */
|
||||
import fs from 'fs';
|
||||
import './styles.css';
|
||||
import path from 'path';
|
||||
```
|
||||
|
||||
While this will pass:
|
||||
|
||||
```js
|
||||
/* eslint import/order: ["error", {"warnOnUnassignedImports": true}] */
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import './styles.css';
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [`import/external-module-folders`] setting
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue