Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions crates/oxc_formatter/tests/ir_transform/sort_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn should_sort() {
r#"
import { b1, type b2, b3 as b33 } from "b";
import * as c from "c";
import type d from "d";
import d from "d";
import a from "a";
"#,
&FormatOptions {
Expand All @@ -39,7 +39,7 @@ import a from "a";
import a from "a";
import { b1, type b2, b3 as b33 } from "b";
import * as c from "c";
import type d from "d";
import d from "d";
"#,
);
// Alphabetical ASC order by default
Expand Down Expand Up @@ -778,14 +778,12 @@ import c from "c";
import z from "z";
"#,
);
// Side effect imports stay in their original positions if `sort_side_effects: false`
assert_format(
r#"
import c from "c";
import b from "b";
import "s";
import y from "y";
import "z";
import "x";
import a from "a";
import z from "z";
"#,
&FormatOptions {
experimental_sort_imports: Some(SortImports {
Expand All @@ -796,12 +794,12 @@ import z from "z";
},
r#"
import a from "a";
import b from "b";
import "s";
import c from "c";
import z from "z";
import "z";
import "x";
import y from "y";
"#,
);
// Keep original order
assert_format(
r#"
import "c";
Expand Down
Loading