chore: make prettier 自动清理前后端无用 import

前端接入 eslint-plugin-unused-imports,pnpm format 同步执行 eslint --fix;
后端将 gofmt 替换为 goimports,并修复 danger-zone 未使用导入。
This commit is contained in:
ryan
2026-07-19 20:47:28 +08:00
parent 4481677ef3
commit d9663f91d6
5 changed files with 46 additions and 4 deletions
+7 -3
View File
@@ -14,9 +14,13 @@ license-check:
scripts/update_go_license.sh --check
prettier:
@echo "==> Formatting backend Go source..."
gofmt -w $$(find . -type f -name '*.go' -not -path './.git/*' -not -path './frontend/*')
@echo "==> Formatting frontend source..."
@echo "==> Formatting backend Go source and removing unused imports..."
@command -v goimports >/dev/null 2>&1 || { \
echo "goimports not found, installing..."; \
go install golang.org/x/tools/cmd/goimports@latest; \
}
goimports -w $$(find . -type f -name '*.go' -not -path './.git/*' -not -path './frontend/*')
@echo "==> Formatting frontend source and removing unused imports..."
cd frontend && pnpm format
build-embedded: