Skip to content

Commit

Permalink
write default option at the top of the option.
Browse files Browse the repository at this point in the history
  • Loading branch information
gwBear1 committed Mar 21, 2024
1 parent 7cdc966 commit 9ff7893
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docs/src/rules/sort-imports.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ import {b, a, c} from 'foo.js'

### `ignoreCase`

Default is `false`.

When `false` (default), uppercase letters of the alphabet must always precede lowercase letters.

When `true`, the rule ignores the case-sensitivity of the imports local name.
Expand Down Expand Up @@ -247,10 +249,10 @@ import a from 'bar.js';

:::

Default is `false`.

### `ignoreDeclarationSort`

Default is `false`.

Ignores the sorting of import declaration statements.

Examples of **incorrect** code for this rule with the default `{ "ignoreDeclarationSort": false }` option:
Expand Down Expand Up @@ -300,10 +302,10 @@ import {b, a, c} from 'foo.js';

:::

Default is `false`.

### `ignoreMemberSort`

Default is `false`.

Ignores the member sorting within a `multiple` member import declaration.

Examples of **incorrect** code for this rule with the default `{ "ignoreMemberSort": false }` option:
Expand Down Expand Up @@ -351,10 +353,10 @@ import a from 'bar.js';

:::

Default is `false`.

### `memberSyntaxSortOrder`

Default is `["none", "all", "multiple", "single"]`.

There are four different styles and the default member syntax sort order is:

* `none` - import module without exported bindings.
Expand Down Expand Up @@ -403,10 +405,10 @@ import {a, b} from 'foo.js';

:::

Default is `["none", "all", "multiple", "single"]`.

### `allowSeparatedGroups`

Default is `false`.

When `true` the rule checks the sorting of import declaration statements only for those that appear on consecutive lines.

In other words, a blank line or a comment line or line with any other statement after an import declaration statement will reset the sorting of import declaration statements.
Expand Down Expand Up @@ -466,8 +468,6 @@ import a from 'baz.js';

:::

Default is `false`.

## When Not To Use It

This rule is a formatting preference and not following it won't negatively affect the quality of your code. If alphabetizing imports isn't a part of your coding standards, then you can leave this rule disabled.

0 comments on commit 9ff7893

Please sign in to comment.