@1adybug/prettier-plugin-sort-imports 0.0.13 → 0.0.15

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.
Files changed (2) hide show
  1. package/dist/index.js +4 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -99,7 +99,9 @@ function formatImportStatement(statement) {
99
99
  const namedPartsWithComments = [];
100
100
  for (const content of importContents){
101
101
  if ("default" === content.name) {
102
- parts.push(content.alias ?? "default");
102
+ if (isExport) if (content.alias) namedParts.push(`default as ${content.alias}`);
103
+ else namedParts.push("default");
104
+ else parts.push(content.alias ?? "default");
103
105
  continue;
104
106
  }
105
107
  if ("*" === content.name) {
@@ -153,7 +155,7 @@ function formatGroups(groups, config) {
153
155
  const separator = config.separator;
154
156
  for(let i = 0; i < groups.length; i++){
155
157
  const group = groups[i];
156
- if (void 0 !== separator) {
158
+ if (void 0 !== separator && i > 0) {
157
159
  let separatorStr;
158
160
  separatorStr = "string" == typeof separator ? separator : separator(group, i);
159
161
  if (void 0 !== separatorStr) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@1adybug/prettier-plugin-sort-imports",
3
3
  "type": "module",
4
- "version": "0.0.13",
4
+ "version": "0.0.15",
5
5
  "description": "一个 Prettier 插件,用于对 JavaScript/TypeScript 文件的导入语句进行分组和排序",
6
6
  "keywords": [
7
7
  "prettier",