1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-06-16 18:10:13 +08:00

chore: add husky and nano-staged

This commit is contained in:
Mr.Hope 2023-04-28 17:52:53 +08:00
parent 881bc5c591
commit a13c531f35
3 changed files with 35 additions and 1 deletions

4
.husky/pre-commit Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
pnpm nano-staged

View File

@ -10,11 +10,21 @@
"docs:build": "vuepress build docs",
"docs:dev": "vuepress dev docs",
"docs:clean-dev": "vuepress dev docs --clean-cache",
"lint": "prettier --check --write . && markdownlint docs/**/*.md"
"lint": "prettier --check --write . && markdownlint docs/**/*.md",
"prepare": "husky install"
},
"nano-staged": {
".ts,.scss": "prettier --write",
".md": [
"prettier --write",
"markdownlint"
]
},
"dependencies": {
"@vuepress/client": "2.0.0-beta.61",
"husky": "^8.0.3",
"markdownlint-cli": "0.33.0",
"nano-staged": "^0.8.0",
"prettier": "2.8.8",
"vue": "3.2.47",
"vuepress": "2.0.0-beta.61",

20
pnpm-lock.yaml generated
View File

@ -4,9 +4,15 @@ dependencies:
'@vuepress/client':
specifier: 2.0.0-beta.61
version: 2.0.0-beta.61
husky:
specifier: ^8.0.3
version: 8.0.3
markdownlint-cli:
specifier: 0.33.0
version: 0.33.0
nano-staged:
specifier: ^0.8.0
version: 0.8.0
prettier:
specifier: 2.8.8
version: 2.8.8
@ -3726,6 +3732,12 @@ packages:
engines: {node: '>=14.18.0'}
dev: false
/husky@8.0.3:
resolution: {integrity: sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==}
engines: {node: '>=14'}
hasBin: true
dev: false
/iconv-lite@0.6.3:
resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==}
engines: {node: '>=0.10.0'}
@ -4364,6 +4376,14 @@ packages:
resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}
dev: false
/nano-staged@0.8.0:
resolution: {integrity: sha512-QSEqPGTCJbkHU2yLvfY6huqYPjdBrOaTMKatO1F8nCSrkQGXeKwtCiCnsdxnuMhbg3DTVywKaeWLGCE5oJpq0g==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
hasBin: true
dependencies:
picocolors: 1.0.0
dev: false
/nanoid@3.3.6:
resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==}
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}