Skip to content

Commit 3288680

Browse files
committed
🐛fix(feature): 处理format空文件
1 parent 927a13e commit 3288680

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/command/prettier-format.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export const prettierFormat = async (
3737

3838
// 获取需要处理的文件
3939
const files = await getEveryFilesBySuffixes(cwd, staged, paths, suffix);
40+
if (files.length === 0) true;
4041

4142
// 运行 write 命令,重写代码风格
4243
await execCommand(

0 commit comments

Comments
 (0)