Skip to content
Closed
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
4 changes: 4 additions & 0 deletions packages/typespec-ts/src/framework/hooks/binder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ class BinderImp implements Binder {
this.resolveDependencyReferences(file);
const importStructures = this.imports.get(file);
if (importStructures) {
// Sort imports in place by module specifier to ensure consistent ordering
importStructures.sort((a, b) =>
a.moduleSpecifier < b.moduleSpecifier ? -1 : 1
);
for (const importStructure of importStructures) {
file.addImportDeclaration(importStructure);
}
Expand Down
Loading