chore: 提交时自动格式化代码
- 安装 husky (^9.1.7) 和 lint-staged (^16.2.7) - 配置 pre-commit hook 自动运行 Prettier - 创建 .prettierignore 排除不需要格式化的文件
This commit is contained in:
25
.prettierignore
Normal file
25
.prettierignore
Normal file
@@ -0,0 +1,25 @@
|
||||
# 依赖和构建产物
|
||||
node_modules/
|
||||
dist/
|
||||
dev/
|
||||
|
||||
# npm lockfile(避免提交时产生大面积格式化 diff)
|
||||
package-lock.json
|
||||
|
||||
# Git 配置文件
|
||||
.gitattributes
|
||||
.gitignore
|
||||
|
||||
# Husky hooks(shell 脚本,不需要 Prettier 格式化)
|
||||
.husky/
|
||||
|
||||
# 缓存文件
|
||||
*.cache
|
||||
.cache/
|
||||
|
||||
# 日志文件
|
||||
*.log
|
||||
|
||||
# 临时文件
|
||||
*.tmp
|
||||
*.temp
|
||||
Reference in New Issue
Block a user