update readme
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
# vsc-sort-import README
|
# vsc-sort-import
|
||||||
|
A personal opinionated EcmaScript import sorting extension for VSCode.
|
||||||
|
|
||||||
Thanks to [Renke Grunwald](https://github.com/renke)'s [nice work](https://github.com/renke/import-sort), it really save me a lot of time so that I can easily make this.
|
Thanks to [Renke Grunwald](https://github.com/renke)'s [nice work](https://github.com/renke/import-sort), it really save me a lot of time so that I can easily make this.
|
||||||
|
|
||||||
@@ -32,15 +33,15 @@ import foo from "./foo";
|
|||||||
|
|
||||||
modules having same hierarchy compose a group. For each group, the order is:
|
modules having same hierarchy compose a group. For each group, the order is:
|
||||||
|
|
||||||
1. imports which have only namespace member
|
1. imports which have only namespace member
|
||||||
eg: `import * as fs from 'fs'`
|
eg: `import * as fs from 'fs'`
|
||||||
2. imports which have only default member
|
2. imports which have only default member
|
||||||
eg: `import fs from 'fs'`
|
eg: `import fs from 'fs'`
|
||||||
3. imports which have both default and namespace member
|
3. imports which have both default and namespace member
|
||||||
eg: `import foo, * as bar from 'foobar'`
|
eg: `import foo, * as bar from 'foobar'`
|
||||||
4. imports which have both default and named member
|
4. imports which have both default and named member
|
||||||
eg: `import foo, { bar } from 'foobar'`
|
eg: `import foo, { bar } from 'foobar'`
|
||||||
5. imports which have only named member
|
5. imports which have only named member
|
||||||
eg: `import { foo, bar } from 'foobar'`
|
eg: `import { foo, bar } from 'foobar'`
|
||||||
|
|
||||||
If the above rule didn't determine the order, then use the first member's name (not alias) to compare. For namespace member, the alias is regarded as its name. The comparison rule is:
|
If the above rule didn't determine the order, then use the first member's name (not alias) to compare. For namespace member, the alias is regarded as its name. The comparison rule is:
|
||||||
@@ -50,10 +51,6 @@ If the above rule didn't determine the order, then use the first member's name (
|
|||||||
|
|
||||||
For imports having no member, sort them by module name with same rule.
|
For imports having no member, sort them by module name with same rule.
|
||||||
|
|
||||||
## Extension Settings
|
|
||||||
|
|
||||||
None.
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
This didn't be published to extension marketplace since it doesn't suitable for most people. So you have to install manually.
|
This didn't be published to extension marketplace since it doesn't suitable for most people. So you have to install manually.
|
||||||
@@ -66,12 +63,15 @@ This didn't be published to extension marketplace since it doesn't suitable for
|
|||||||
## Build
|
## Build
|
||||||
|
|
||||||
clone this repo:
|
clone this repo:
|
||||||
|
|
||||||
> `git clone https://github.com/mattuylee/vsc-sort-import`
|
> `git clone https://github.com/mattuylee/vsc-sort-import`
|
||||||
|
|
||||||
change into repo directory and install dependencies:
|
change into repo directory and install dependencies:
|
||||||
|
|
||||||
> `cd vsc-sort-import && npm install`
|
> `cd vsc-sort-import && npm install`
|
||||||
|
|
||||||
package VSIX file:
|
package VSIX file:
|
||||||
|
|
||||||
> `npx vsce package`
|
> `npx vsce package`
|
||||||
|
|
||||||
## Debug
|
## Debug
|
||||||
|
|||||||
Reference in New Issue
Block a user