From afa56e916eb199d34e45022732c164e59d2aa36f Mon Sep 17 00:00:00 2001 From: GyDi Date: Sat, 25 Dec 2021 17:04:55 +0800 Subject: [PATCH] chore: add husky --- .husky/pre-commit | 4 ++++ package.json | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..f3a6796 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +yarn pretty-quick --staged diff --git a/package.json b/package.json index 3e5d2cd..221aa9f 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "web:dev": "vite", "web:build": "tsc && vite build", "web:serve": "vite preview", - "predev": "node scripts/pre-dev.mjs" + "predev": "node scripts/pre-dev.mjs", + "prepare": "husky install" }, "dependencies": { "@emotion/react": "^11.7.0", @@ -32,9 +33,17 @@ "@vitejs/plugin-react": "^1.1.1", "adm-zip": "^0.5.9", "fs-extra": "^10.0.0", + "husky": "^7.0.0", "node-fetch": "^3.1.0", + "pretty-quick": "^3.1.3", "sass": "^1.44.0", "typescript": "^4.5.2", "vite": "^2.7.1" + }, + "prettier": { + "tabWidth": 2, + "semi": true, + "singleQuote": false, + "endOfLine": "lf" } }