refactor(frontend): optimize pre-commit lint script (#10870)

Co-authored-by: amanape <83104063+amanape@users.noreply.github.com>
This commit is contained in:
Hiep Le
2025-09-12 22:23:29 +07:00
committed by GitHub
parent 69498bebb4
commit 8dc46b7206
2 changed files with 7 additions and 2 deletions

View File

@@ -1,8 +1,6 @@
# Run frontend checks # Run frontend checks
echo "Running frontend checks..." echo "Running frontend checks..."
cd frontend cd frontend
npm run lint
npm run check-translation-completeness
npx lint-staged npx lint-staged
# Run backend pre-commit # Run backend pre-commit

View File

@@ -77,12 +77,19 @@
"lint:fix": "eslint src --ext .ts,.tsx,.js --fix && prettier --write src/**/*.{ts,tsx}", "lint:fix": "eslint src --ext .ts,.tsx,.js --fix && prettier --write src/**/*.{ts,tsx}",
"prepare": "cd .. && husky frontend/.husky", "prepare": "cd .. && husky frontend/.husky",
"typecheck": "react-router typegen && tsc", "typecheck": "react-router typegen && tsc",
"typecheck:staged": "react-router typegen && npx tsc --noEmit --skipLibCheck",
"check-translation-completeness": "node scripts/check-translation-completeness.cjs" "check-translation-completeness": "node scripts/check-translation-completeness.cjs"
}, },
"lint-staged": { "lint-staged": {
"src/**/*.{ts,tsx,js}": [ "src/**/*.{ts,tsx,js}": [
"eslint --fix", "eslint --fix",
"prettier --write" "prettier --write"
],
"src/**/*.{ts,tsx}": [
"bash -c 'npm run typecheck:staged'"
],
"src/**/*": [
"npm run check-translation-completeness"
] ]
}, },
"devDependencies": { "devDependencies": {