set up commit hook

This commit is contained in:
ClasWen 2024-05-18 21:07:46 +08:00
parent a9e311af3b
commit 02d3452100
2 changed files with 7 additions and 2 deletions

1
.husky/pre-commit Normal file
View file

@ -0,0 +1 @@
npx lint-staged

View file

@ -8,7 +8,8 @@
"build": "astro build",
"preview": "astro preview",
"lint": "eslint",
"astro": "astro"
"astro": "astro",
"prepare": "husky"
},
"dependencies": {
"@astrojs/react": "^3.3.1",
@ -45,5 +46,8 @@
"lint-staged": "^15.2.2",
"typescript": "^5.4.5",
"typescript-eslint": "^7.9.0"
},
"lint-staged": {
"*.{js,jsx,mjs,ts,tsx,mts,astro}": "eslint --fix"
}
}
}