Update sortImports to support --import-grouping length,alpha (#2463)

Co-authored-by: calda <1811727+calda@users.noreply.github.com>
This commit is contained in:
Copilot
2026-03-17 07:14:01 -07:00
committed by Cal Stephens
parent 357efe0348
commit 3f4f61ba85
2 changed files with 39 additions and 1 deletions
+7 -1
View File
@@ -84,7 +84,13 @@ extension Formatter {
}
if grouping.contains(.length) {
return lhs.module.count < rhs.module.count
if lhs.module.count != rhs.module.count {
return lhs.module.count < rhs.module.count
}
if grouping.contains(.alpha) {
return lhs < rhs
}
return false
}
// Default to alphabetical
return lhs < rhs