@1adybug/prettier-plugin-sort-imports 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -99,7 +99,8 @@ function formatImportStatement(statement) {
|
|
|
99
99
|
const namedPartsWithComments = [];
|
|
100
100
|
for (const content of importContents){
|
|
101
101
|
if ("default" === content.name) {
|
|
102
|
-
|
|
102
|
+
if (isExport && content.alias) namedParts.push(`default as ${content.alias}`);
|
|
103
|
+
else parts.push(content.alias ?? "default");
|
|
103
104
|
continue;
|
|
104
105
|
}
|
|
105
106
|
if ("*" === content.name) {
|
|
@@ -153,7 +154,7 @@ function formatGroups(groups, config) {
|
|
|
153
154
|
const separator = config.separator;
|
|
154
155
|
for(let i = 0; i < groups.length; i++){
|
|
155
156
|
const group = groups[i];
|
|
156
|
-
if (void 0 !== separator) {
|
|
157
|
+
if (void 0 !== separator && i > 0) {
|
|
157
158
|
let separatorStr;
|
|
158
159
|
separatorStr = "string" == typeof separator ? separator : separator(group, i);
|
|
159
160
|
if (void 0 !== separatorStr) {
|