diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..32f9932 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npm run lint && npm run format:check diff --git a/package.json b/package.json index 605e934..6074011 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "preview": "vite preview", "format": "prettier --write \"src/**/*.{ts,tsx}\"", "lint": "eslint --ext .js,.jsx,.ts,.tsx src --fix", - "format:check": "prettier --check \"src/**/*.{ts,tsx}\"" + "format:check": "prettier --check \"src/**/*.{ts,tsx}\"", + "prepare": "husky install" }, "dependencies": { "dotenv": "^16.0.3", @@ -26,6 +27,7 @@ "eslint": "^8.38.0", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.3.4", + "husky": "^8.0.3", "typescript": "^5.0.2", "vite": "^4.3.2" }