Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
IanVS committed May 17, 2022
1 parent 489d9d2 commit b601cd8
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ A collection of Regular expressions in string format.
"importOrder": ["^@core/(.*)$", "^@server/(.*)$", "^@ui/(.*)$", "^[./]"],
```

_Default behavior:_ The plugin moves the third party imports to the top which are not part of the `importOrder` list.
_Default:_ `[]`

By default, this plugin will not move any imports. To separate third party from relative imports, use `["^[./]"]`. This will become the default in the next major version.

The plugin moves the third party imports to the top which are not part of the `importOrder` list.
To move the third party imports at desired place, you can use `<THIRD_PARTY_MODULES>` to assign third party imports to the appropriate position:

```json
Expand All @@ -149,6 +153,18 @@ between sorted import declarations group. The separation takes place according t
"importOrderSeparation": true,
```

_Note:_ If you want greater control over which groups are separated from others, you can add an empty string to your `importOrder` array to signify newlines. For example:

```js
"importOrderSeparation": false,
"importOrder": [
"^react", // React will be placed at the top of third-party modules
"<THIRD_PARTY_MODULES>",
"", // use empty strings to separate groups with empty lines
"^[./]"
],
```

#### `importOrderSortSpecifiers`

**type**: `boolean`
Expand Down

0 comments on commit b601cd8

Please sign in to comment.