mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 05:37:20 +08:00
refactor(frontend): optimize pre-commit lint script (#10870)
Co-authored-by: amanape <83104063+amanape@users.noreply.github.com>
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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": {
|
||||||
|
|||||||
Reference in New Issue
Block a user