@so1ve/eslint-plugin-sort-imports 0.105.2 → 0.106.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 +9 -0
package/package.json
CHANGED
package/src/shared.js
CHANGED
|
@@ -48,6 +48,15 @@ const naturalSort = natsort.default();
|
|
|
48
48
|
function compare(path1, path2) {
|
|
49
49
|
const path1Depth = path1.split("-").filter((p) => p === "__").length;
|
|
50
50
|
const path2Depth = path2.split("-").filter((p) => p === "__").length;
|
|
51
|
+
const path1IsDot = path1 === "_-,";
|
|
52
|
+
const path2IsDot = path2 === "_-,";
|
|
53
|
+
|
|
54
|
+
if (path1IsDot && !path2IsDot) {
|
|
55
|
+
return 1;
|
|
56
|
+
}
|
|
57
|
+
if (path2IsDot && !path1IsDot) {
|
|
58
|
+
return -1;
|
|
59
|
+
}
|
|
51
60
|
|
|
52
61
|
return path1Depth === path2Depth
|
|
53
62
|
? naturalSort(path1, path2)
|