chore(i18n): regen typings before formatting to keep keys in sync

This commit is contained in:
Slinetrac
2025-11-06 22:23:40 +08:00
Unverified
parent ecd92976df
commit 4ad72d21be

View File

@@ -9,6 +9,19 @@ if ! command -v pnpm >/dev/null 2>&1; then
exit 1
fi
LOCALE_DIFF="$(git diff --cached --name-only --diff-filter=ACMR | grep -E '^src/locales/' || true)"
if [ -n "$LOCALE_DIFF" ]; then
echo "[pre-commit] Locale changes detected. Regenerating i18n types..."
pnpm i18n:types
if [ -d src/types/generated ]; then
echo "[pre-commit] Staging regenerated i18n type artifacts..."
git add src/types/generated
fi
fi
echo "[pre-commit] Running pnpm format before lint..."
pnpm format
echo "[pre-commit] Running lint-staged for JS/TS files..."
pnpm exec lint-staged