You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/rules/order.md
+9-7
Original file line number
Diff line number
Diff line change
@@ -738,16 +738,18 @@ When set to `"inside-groups"`, this ensures imports spanning multiple lines are
738
738
>
739
739
> When all of the following are true:
740
740
>
741
-
> -`consolidateIslands` is set to `"inside-groups"`
742
-
> -[`newlines-between`][20] is set to `"always-and-inside-groups"`
743
-
> -[`newlines-between-types`][27] is set to `"never"`
744
741
> -[`sortTypesGroup`][7] is set to `true`
742
+
> -`consolidateIslands` is set to `"inside-groups"`
743
+
> -[`newlines-between`][20] is set to `"always-and-inside-groups"` when [`newlines-between-types`][27] is set to `"never"` (or vice-versa)
745
744
>
746
-
> Then [`newlines-between-types`][27] will yield to `consolidateIslands` and allow new lines to separate multi-line imports and a single new line to separate all [type-only imports][6] from all normal imports. Other than that, [`newlines-between-types: "never"`][27] functions as described.
745
+
> Then [`newlines-between`][20]/[`newlines-between-types`][27] will yield to
746
+
> `consolidateIslands` and allow new lines to separate multi-line imports
747
+
> regardless of the `"never"` setting.
747
748
>
748
-
> This configuration is useful to keep type-only imports stacked tightly
749
-
> together at the bottom of your import block to preserve space while still
750
-
> logically organizing normal imports for quick and pleasant reference.
749
+
> This configuration is useful, for instance, to keep single-line type-only
750
+
> imports stacked tightly together at the bottom of your import block to
751
+
> preserve space while still logically organizing normal imports for quick and
Copy file name to clipboardexpand all lines: tests/src/rules/order.js
+167-1
Original file line number
Diff line number
Diff line change
@@ -4158,7 +4158,7 @@ context('TypeScript', function () {
4158
4158
},
4159
4159
],
4160
4160
}),
4161
-
// Ensure consolidateOptions: 'inside-groups', newlines-between: 'always-and-inside-groups', and newlines-between-types: 'never' do not fight for dominance
4161
+
// Ensure consolidateIslands: 'inside-groups', newlines-between: 'always-and-inside-groups', and newlines-between-types: 'never' do not fight for dominance
4162
4162
test({
4163
4163
code: `
4164
4164
import makeVanillaYargs from 'yargs/yargs';
@@ -4228,6 +4228,172 @@ context('TypeScript', function () {
4228
4228
},
4229
4229
],
4230
4230
}),
4231
+
// Ensure consolidateIslands: 'inside-groups', newlines-between: 'never', and newlines-between-types: 'always-and-inside-groups' do not fight for dominance
4232
+
test({
4233
+
code: `
4234
+
import makeVanillaYargs from 'yargs/yargs';
4235
+
import { createDebugLogger } from 'multiverse+rejoinder';
4236
+
import { globalDebuggerNamespace } from 'rootverse+bfe:src/constant.ts';
4237
+
import { ErrorMessage, type KeyValueEntry } from 'rootverse+bfe:src/error.ts';
4238
+
import { $artificiallyInvoked } from 'rootverse+bfe:src/symbols.ts';
0 commit comments