From 48b7edc35f645facc64c4950b64f3f3455cebb8a Mon Sep 17 00:00:00 2001 From: Tom Xu Date: Mon, 19 Apr 2021 11:30:51 +0800 Subject: [PATCH] chore: upgrade husky to v6 (#29535) * chore: upgrade husky to v5 * Update package.json * add prepare for husky * fix chmod Co-authored-by: yoyo837 --- .husky/.gitignore | 1 + .husky/pre-commit | 4 ++++ package.json | 8 ++------ 3 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 .husky/.gitignore create mode 100755 .husky/pre-commit diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 0000000000..31354ec138 --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000000..f91359dc2a --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install pretty-quick --staged diff --git a/package.json b/package.json index ebfceca659..2604aeb1ce 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "unpkg": "dist/antd.min.js", "typings": "lib/index.d.ts", "scripts": { + "prepare": "husky install", "api-collection": "antd-tools run api-collection", "authors": "node ./scripts/generate-authors", "build": "npm run compile && NODE_OPTIONS='--max-old-space-size=4096' npm run dist", @@ -97,11 +98,6 @@ "install-react-16": "npm i --no-save react@16 react-dom@16 react-test-renderer@16 enzyme-adapter-react-16", "argos": "argos upload imageSnapshots" }, - "husky": { - "hooks": { - "pre-commit": "pretty-quick --staged" - } - }, "browserslist": [ "> 0.5%", "last 2 versions", @@ -217,7 +213,7 @@ "full-icu": "^1.3.0", "glob": "^7.1.4", "http-server": "^0.12.0", - "husky": "^4.0.3", + "husky": "^6.0.0", "identity-obj-proxy": "^3.0.0", "ignore-emit-webpack-plugin": "^2.0.6", "immer": "^9.0.1",