@1adybug/prettier-plugin-sort-imports 0.0.24 → 0.0.25

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 +2 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -79,10 +79,10 @@ function removeUnusedImportsFromStatements(importStatements, code) {
79
79
  }
80
80
  return filteredStatements;
81
81
  }
82
- function formatImportStatement(statement, trailingComma = "es5") {
82
+ function formatImportStatement(statement, trailingComma) {
83
83
  const { path, isExport, isSideEffect, importContents, leadingComments, trailingComments, removedTrailingComments, emptyLinesAfterComments } = statement;
84
84
  const lines = [];
85
- const shouldAddTrailingComma = "none" !== trailingComma;
85
+ const shouldAddTrailingComma = (trailingComma ?? "all") !== "none";
86
86
  if (leadingComments && leadingComments.length > 0) {
87
87
  lines.push(...leadingComments);
88
88
  const emptyLines = emptyLinesAfterComments ?? 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1adybug/prettier-plugin-sort-imports",
3
- "version": "0.0.24",
3
+ "version": "0.0.25",
4
4
  "description": "一个 Prettier 插件,用于对 JavaScript/TypeScript 文件的导入语句进行分组和排序",
5
5
  "keywords": [
6
6
  "prettier",