@so1ve/eslint-plugin-sort-imports 3.23.0 → 3.25.0
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/package.json +1 -1
- package/src/shared.js +4 -8
package/package.json
CHANGED
package/src/shared.js
CHANGED
|
@@ -381,10 +381,8 @@ function printSortedItems(sortedItems, originalItems, sourceCode) {
|
|
|
381
381
|
includeComments: true,
|
|
382
382
|
filter: (token) =>
|
|
383
383
|
!isLineComment(token) &&
|
|
384
|
-
!(
|
|
385
|
-
|
|
386
|
-
token.loc.end.line === lastOriginalItem.node.loc.end.line
|
|
387
|
-
),
|
|
384
|
+
(!isBlockComment(token) ||
|
|
385
|
+
token.loc.end.line !== lastOriginalItem.node.loc.end.line),
|
|
388
386
|
})
|
|
389
387
|
: undefined;
|
|
390
388
|
const maybeNewline =
|
|
@@ -576,10 +574,8 @@ function printWithSortedSpecifiers(node, sourceCode, getSpecifiers) {
|
|
|
576
574
|
const maybeNewline =
|
|
577
575
|
previous != null &&
|
|
578
576
|
needsStartingNewline(item.before) &&
|
|
579
|
-
|
|
580
|
-
previous.after.length
|
|
581
|
-
isNewline(previous.after[previous.after.length - 1])
|
|
582
|
-
)
|
|
577
|
+
(previous.after.length <= 0 ||
|
|
578
|
+
!isNewline(previous.after[previous.after.length - 1]))
|
|
583
579
|
? [{ type: "Newline", code: newline }]
|
|
584
580
|
: [];
|
|
585
581
|
|