fix: lint-staged 移除 Go gofmt 规则

Go 工具链不在 git hook(Git Bash)PATH 中,gofmt 执行失败。
Go 文件格式化由开发者手动执行 go fmt。
This commit is contained in:
SpecialX
2026-07-08 12:51:46 +08:00
parent d831915f06
commit 75804c7d64
3 changed files with 376 additions and 3 deletions

View File

@@ -1,10 +1,9 @@
module.exports = {
// ESLint 9 flat config 迁移完成后恢复:['eslint --fix', 'prettier --write']
'*.{ts,tsx}': ['prettier --write'],
// Go 工具链不在 git hook PATH 中Go 文件格式化由 go fmt 手动执行
// golangci-lint 安装后恢复:['gofmt -w', 'golangci-lint run --fix']
// gofmt 仅处理 .go 文件,.mod/.sum 不需要格式化
'*.go': ['gofmt -w'],
'*.{py}': ['ruff check --fix', 'ruff format'],
'*.py': ['ruff check --fix', 'ruff format'],
'*.proto': ['buf format --write'],
'*.md': ['prettier --write'],
};