Skip to content

Commit

Permalink
Remove duplicated newLineNodes with manual separators
Browse files Browse the repository at this point in the history
  • Loading branch information
forivall committed Nov 8, 2024
1 parent 18aa9dc commit 7817a93
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils/get-sorted-nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ export const getSortedNodes: GetSortedNodes = (nodes, options) => {

for (const group of importOrder) {
if (group === SEPARATOR_SPECIAL_WORD) {
if (!importOrderSeparation)
if (
finalNodes.length !== 0 &&
finalNodes[finalNodes.length - 1] !== newLineNode
) {
finalNodes.push(newLineNode);
}
continue;
}

Expand Down

0 comments on commit 7817a93

Please sign in to comment.