1. Husky

https://github.com/typicode/husky

https://typicode.github.io/husky/#/

1.1. 基础使用

  • step-1: 安装 husky 包
npm install husky -D
  • step-2: 生成 .husky 文件
// package.json 添加脚本

{
  "prepare": "husky install"
}

// 执行脚本

npm run prepare
  • step-3: 添加 hook
npx husky add .husky/pre-commit "npm run lint"
Copyright © tomgou 2022 all right reserved,powered by Gitbook该文章修订时间: 2023-08-28 17:33:23

results matching ""

    No results matching ""