From 9bd4a57cade0e9a7601f74e7b73ab44bb6d5d23c Mon Sep 17 00:00:00 2001 From: hooray <304327508@qq.com> Date: Wed, 9 Nov 2022 16:04:56 +0800 Subject: [PATCH] =?UTF-8?q?husky=20=E6=9B=BF=E6=8D=A2=E4=B8=BA=20simple-gi?= =?UTF-8?q?t-hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .husky/pre-commit | 4 ---- package.json | 9 ++++++--- pnpm-lock.yaml | 16 ++++++++-------- 3 files changed, 14 insertions(+), 15 deletions(-) delete mode 100644 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100644 index fab6428..0000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -pnpm lint-staged diff --git a/package.json b/package.json index 44c9ef2..bd9df25 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,7 @@ "lint:tsc": "vue-tsc --noEmit", "lint:eslint": "eslint src/**/*.{ts,tsx,vue} --cache --fix", "lint:stylelint": "stylelint src/**/*.{css,scss,vue} --cache --fix", - "prepare": "husky install", - "postinstall": "esno scripts/prepare.js", + "postinstall": "simple-git-hooks && esno scripts/prepare.js", "preinstall": "npx only-allow pnpm" }, "dependencies": { @@ -47,12 +46,12 @@ "esno": "^0.16.3", "fs-extra": "^10.1.0", "http-server": "^14.1.1", - "husky": "^8.0.1", "lint-staged": "^13.0.3", "npm-run-all": "^4.1.5", "plop": "^3.1.1", "postcss-html": "^1.5.0", "sass": "^1.56.0", + "simple-git-hooks": "^2.8.1", "stylelint": "^14.14.1", "stylelint-config-standard": "^29.0.0", "stylelint-config-standard-scss": "^6.1.0", @@ -73,5 +72,9 @@ "vite-plugin-vue-layouts": "^0.6.0", "vite-plugin-vue-setup-extend": "^0.4.0", "vue-tsc": "^1.0.9" + }, + "simple-git-hooks": { + "pre-commit": "pnpm lint-staged", + "preserveUnused": true } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4dc22be..b379f42 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,7 +21,6 @@ specifiers: fs-extra: ^10.1.0 hotkeys-js: ^3.10.0 http-server: ^14.1.1 - husky: ^8.0.1 lint-staged: ^13.0.3 lodash-es: ^4.17.21 mitt: ^3.0.0 @@ -35,6 +34,7 @@ specifiers: postcss-html: ^1.5.0 qs: ^6.11.0 sass: ^1.56.0 + simple-git-hooks: ^2.8.1 stylelint: ^14.14.1 stylelint-config-standard: ^29.0.0 stylelint-config-standard-scss: ^6.1.0 @@ -93,12 +93,12 @@ devDependencies: esno: 0.16.3 fs-extra: 10.1.0 http-server: 14.1.1 - husky: 8.0.1 lint-staged: 13.0.3 npm-run-all: 4.1.5 plop: 3.1.1 postcss-html: 1.5.0 sass: 1.56.0 + simple-git-hooks: 2.8.1 stylelint: 14.14.1 stylelint-config-standard: 29.0.0_stylelint@14.14.1 stylelint-config-standard-scss: 6.1.0_stylelint@14.14.1 @@ -4017,12 +4017,6 @@ packages: engines: {node: '>=12.20.0'} dev: true - /husky/8.0.1: - resolution: {integrity: sha512-xs7/chUH/CKdOCs7Zy0Aev9e/dKOMZf3K1Az1nar3tzlv0jfqnYtu235bstsWTmXOR0EfINrPa97yy4Lz6RiKw==} - engines: {node: '>=14'} - hasBin: true - dev: true - /iconv-lite/0.4.24: resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} engines: {node: '>=0.10.0'} @@ -6360,6 +6354,12 @@ packages: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} dev: true + /simple-git-hooks/2.8.1: + resolution: {integrity: sha512-DYpcVR1AGtSfFUNzlBdHrQGPsOhuuEJ/FkmPOOlFysP60AHd3nsEpkGq/QEOdtUyT1Qhk7w9oLmFoMG+75BDog==} + hasBin: true + requiresBuild: true + dev: true + /slash/3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'}