From 3ae0fc76a75d8b23e219dd84e85e781ea5f2a068 Mon Sep 17 00:00:00 2001 From: Seviche Date: Wed, 29 Mar 2023 17:17:48 +0800 Subject: [PATCH] chore: add husky --- .husky/pre-commit | 4 ++++ package.json | 4 +++- pnpm-lock.yaml | 9 +++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100755 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..67e2f4c --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +pnpm lint:fix diff --git a/package.json b/package.json index 3b52086..cd56691 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "build": "vue-tsc && vite build", "preview": "vite preview", "lint": "eslint .", - "lint:fix": "eslint . --fix" + "lint:fix": "eslint . --fix", + "prepare": "husky install" }, "dependencies": { "@egoist/tailwindcss-icons": "^1.0.7", @@ -33,6 +34,7 @@ "autoprefixer": "^10.4.14", "daisyui": "^2.51.5", "eslint": "^8.36.0", + "husky": "^8.0.3", "postcss": "^8.4.21", "tailwindcss": "^3.2.7", "typescript": "^5.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6902873..a83ba68 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -63,6 +63,9 @@ devDependencies: eslint: specifier: ^8.36.0 version: 8.36.0 + husky: + specifier: ^8.0.3 + version: 8.0.3 postcss: specifier: ^8.4.21 version: 8.4.21 @@ -2565,6 +2568,12 @@ packages: engines: {node: '>=10.17.0'} dev: false + /husky@8.0.3: + resolution: {integrity: sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==} + engines: {node: '>=14'} + hasBin: true + dev: true + /ignore@5.2.4: resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} engines: {node: '>= 4'}