redlint 3.22.2 → 3.22.4

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/ChangeLog CHANGED
@@ -1,3 +1,13 @@
1
+ 2025.03.19, v3.22.4
2
+
3
+ feature:
4
+ - c285c55 redlint: edit: rename file: simplify
5
+
6
+ 2025.03.17, v3.22.3
7
+
8
+ fix:
9
+ - b2efeb3 redlint: edit
10
+
1
11
  2025.03.17, v3.22.2
2
12
 
3
13
  feature:
package/lib/edit/edit.js CHANGED
@@ -39,7 +39,7 @@ export const edit = (filesystem, {dir, nested, full}, overrides = {}) => {
39
39
 
40
40
  const newNames = to
41
41
  .split('\n')
42
- .filter(Boolean);
42
+ .slice(0, -1);
43
43
 
44
44
  removeTmpFile();
45
45
 
@@ -8,7 +8,7 @@ const {
8
8
  getFilename,
9
9
  getParentDirectory,
10
10
  removeFile,
11
- readDirectory,
11
+ removeEmptyDirectory,
12
12
  } = operator;
13
13
 
14
14
  export const report = (filePath, {from, to}) => `Rename '${from}' to '${to}'`;
@@ -24,7 +24,7 @@ export const fix = (filePath, {to}) => {
24
24
  const dir = getParentDirectory(filePath);
25
25
 
26
26
  removeFile(filePath);
27
- removeEmptyNestedDirectory(dir);
27
+ removeEmptyDirectory(dir);
28
28
 
29
29
  return;
30
30
  }
@@ -46,10 +46,7 @@ const addFromTo = (namesFrom, namesTo) => (a, i) => [
46
46
  ];
47
47
 
48
48
  export const scan = (path, {push, trackFile, options}) => {
49
- const {
50
- from = [],
51
- to = [],
52
- } = options;
49
+ const {from = [], to = []} = options;
53
50
 
54
51
  if (from.length !== to.length)
55
52
  return;
@@ -107,18 +104,3 @@ function isEqual(a, b) {
107
104
 
108
105
  return is;
109
106
  }
110
-
111
- function removeEmptyNestedDirectory(parentDir) {
112
- let nextParentDir = parentDir;
113
-
114
- while (!readDirectory(parentDir).length) {
115
- const name = getFilename(parentDir);
116
-
117
- if (name === '/')
118
- break;
119
-
120
- nextParentDir = getParentDirectory(parentDir);
121
- removeFile(parentDir);
122
- parentDir = nextParentDir;
123
- }
124
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "redlint",
3
- "version": "3.22.2",
3
+ "version": "3.22.4",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "Lint Filesystem with 🐊Putout",