vue3: 21. Configure code inspection workflow (husky)

pnpm install husky-init

git init
pnpm dlx husky-init ; pnpm install

   Other commands to install 

npx husky-init ; npm install       # npm
npx husky-init ; yarn              # Yarn 1
yarn dlx husky-init --yarn2 ; yarn # Yarn 2+
pnpm dlx husky-init ; pnpm install # pnpm

pnpm install lint-staged

pnpm i lint-staged -D

 Configure package.json

  "lint-staged": {
    "*.{js,ts,vue}": [
      "eslint --fix"
    ]
  }

 Modify the configuration of husky

#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

#npm test 
#pnpm lint
pnpm  lint-staged

Guess you like

Origin blog.csdn.net/qq_37899792/article/details/132752859
21.