diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 000000000..aef59bf74 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,6 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npm run pretty-quick +cargo fmt +git add . \ No newline at end of file diff --git a/package.json b/package.json index 8c527196a..96e77cd7c 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,9 @@ "fmt:rs": "cargo fmt", "tr": "tr", "tauri": "tauri", - "prettier": "prettier -c --write '**/*'", - "pretty-quick": "pretty-quick" + "prettier": "prettier -c --write '**/*.{js,md,ts,tsx,yml}'", + "pretty-quick": "pretty-quick --staged", + "prepare": "husky install" }, "license": "MIT", "author": "lencx ", @@ -35,11 +36,6 @@ "type": "git", "url": "https://github.com/lencx/ChatGPT" }, - "husky": { - "hooks": { - "pre-commit": "pretty-quick --staged" - } - }, "dependencies": { "@ant-design/icons": "^4.8.0", "@monaco-editor/react": "^4.4.6",