Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
k2snowman69 and renovate[bot] authored Jan 25, 2025
1 parent fac25d5 commit f60af26
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
7 changes: 4 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions src/language-js/sortImportDeclarations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,17 @@ function getFirstSpecifier(declaration: ModuleDeclaration) {
case "ExportDefaultDeclaration":
return "";
case "ExportNamedDeclaration":
case "ImportDeclaration":
return declaration.specifiers[0]?.local.name || "";
case "ImportDeclaration": {
const local = declaration.specifiers[0]?.local;
switch (local?.type) {
case "Identifier":
return local.name || "";
case "Literal":
return local.value?.toString() || "";
default:
return "";
}
}
}
}

Expand Down

0 comments on commit f60af26

Please sign in to comment.