From b601cd82713c85c95f26e5e5f36fd70d6bb2d79a Mon Sep 17 00:00:00 2001 From: Ian VanSchooten Date: Thu, 12 May 2022 11:52:04 -0400 Subject: [PATCH] Update README --- README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7d6ec44..6f4ed53 100644 --- a/README.md +++ b/README.md @@ -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 `` to assign third party imports to the appropriate position: ```json @@ -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 + "", + "", // use empty strings to separate groups with empty lines + "^[./]" +], +``` + #### `importOrderSortSpecifiers` **type**: `boolean`