Skip to content

Commit c1dc0d9

Browse files
committed
fix sorting for Node 11
1 parent a7779b3 commit c1dc0d9

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/utils/sortRules.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ function byExport(a, b) {
1313
}
1414

1515
function byLine(a, b) {
16-
if (
17-
isExport(a.selectors) &&
18-
isExport(b.selectors) &&
19-
a.position.start.line > b.position.start.line
20-
) {
21-
return 1;
16+
if (isExport(a.selectors) && isExport(b.selectors)) {
17+
if (a.position.start.line > b.position.start.line) {
18+
return 1;
19+
}
20+
if (a.position.start.line < b.position.start.line) {
21+
return -1;
22+
}
2223
}
2324
return 0;
2425
}

0 commit comments

Comments
 (0)