@d-zero/lint-staged-config 5.0.0-dev.86 → 5.0.0-dev.89
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/index.mjs +11 -11
- package/package.json +2 -2
package/index.mjs
CHANGED
|
@@ -17,24 +17,24 @@ export default function (dir, mapping) {
|
|
|
17
17
|
const commandList = [];
|
|
18
18
|
const cwd = process.cwd();
|
|
19
19
|
|
|
20
|
-
dir =
|
|
21
|
-
? //
|
|
22
|
-
cwd
|
|
23
|
-
: // 絶対パスかどうか
|
|
20
|
+
dir = dir
|
|
21
|
+
? // 絶対パスかどうか
|
|
24
22
|
path.isAbsolute(dir)
|
|
25
23
|
? // 絶対パスならそのまま
|
|
26
24
|
dir
|
|
27
25
|
: // 相対パスなら絶対パスに変換
|
|
28
|
-
path.resolve(cwd, dir)
|
|
26
|
+
path.resolve(cwd, dir)
|
|
27
|
+
: // 引数がないならカレントディレクトリ
|
|
28
|
+
cwd;
|
|
29
29
|
|
|
30
30
|
mapping = mapping ?? defaultMapping;
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
for (const [ext, commandTypes] of Object.entries(mapping)) {
|
|
33
|
+
for (const commandType of commandTypes) {
|
|
34
34
|
const shell = commands[commandType];
|
|
35
35
|
|
|
36
36
|
if (!shell) {
|
|
37
|
-
|
|
37
|
+
continue;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
const pattern = path
|
|
@@ -46,12 +46,12 @@ export default function (dir, mapping) {
|
|
|
46
46
|
const targetFiles = micromatch(files, pattern);
|
|
47
47
|
|
|
48
48
|
if (targetFiles.length <= 0) {
|
|
49
|
-
|
|
49
|
+
continue;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
commandList.push(shell + ' ' + targetFiles.map((f) => `"${f}"`).join(' '));
|
|
53
|
-
}
|
|
54
|
-
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
55
|
|
|
56
56
|
return commandList;
|
|
57
57
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d-zero/lint-staged-config",
|
|
3
|
-
"version": "5.0.0-dev.
|
|
3
|
+
"version": "5.0.0-dev.89+925fa30",
|
|
4
4
|
"description": "Configurations of lint-staged",
|
|
5
5
|
"repository": "https://github.com/d-zero-dev/node-dev-env.git",
|
|
6
6
|
"author": "D-ZERO Co., Ltd.",
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"lint-staged": "15.2.0"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "925fa30b4143c9626d26e9faaba152098d1d10d2"
|
|
25
25
|
}
|