Skip to content

Commit 880de18

Browse files
committed
Enhance linting and formatting setup for frontend and backend projects
1 parent 1233956 commit 880de18

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

.husky/pre-commit

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,20 @@ sh ./lizard.sh
55

66
# Only run frontend lint if the directory exists
77
if [ -d "frontend" ]; then
8-
cd frontend && npm run lint
8+
cd frontend
9+
npx lint-staged
10+
npm run lint
11+
cd ..
912
fi
1013

1114
cd $project_root
1215

13-
# Add backend linting
16+
# Add backend linting and formatting
1417
if [ -d "backend" ]; then
15-
cd backend && npm run lint
18+
cd backend
19+
npx lint-staged
20+
npm run lint
21+
cd ..
1622
fi
1723

1824
exit 0

backend/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
"cdk:destroy": "dotenv -- npx cdk destroy",
2727
"cdk:synth": "dotenv -- npx cdk synth"
2828
},
29+
"lint-staged": {
30+
"*.ts": [
31+
"prettier --write"
32+
]
33+
},
2934
"dependencies": {
3035
"@aws-sdk/client-bedrock": "^3.782.0",
3136
"@aws-sdk/client-bedrock-runtime": "^3.782.0",

frontend/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,12 @@
2828
"lint-staged": {
2929
"*.{ts,tsx}": [
3030
"eslint --fix",
31+
"prettier --write",
3132
"vitest related --run"
3233
],
34+
"*.{js,jsx,css,scss,md,json}": [
35+
"prettier --write"
36+
],
3337
"*.scss": [
3438
"stylelint --fix"
3539
]

0 commit comments

Comments
 (0)