Skip to content

Commit 97689ab

Browse files
authored
fix: 引入lint-staged格式化提交内容,修复git提交前hooks执行异常 (#91)
1 parent 324a422 commit 97689ab

File tree

4 files changed

+95
-1
lines changed

4 files changed

+95
-1
lines changed

.lintstagedrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// 参考: https://www.npmjs.com/package/lint-staged#configuration
2+
module.exports = {
3+
"*.*": "./scripts/lint"
4+
}

docs/quick-start.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ title: 快速开始
33
permalink: /quick-start.html
44
headerDepth: 2
55
---
6+
# 快速开始
7+
68
<!-- @include: ../README.md#quick-start -->

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"scripts": {
1111
"preinstall": "chmod +x ./scripts/*",
12-
"prepare": "rm -f .husky/pre-commit && husky install && npx husky add .husky/pre-commit \"./scripts/lint\" && chmod +x .husky/pre-commit",
12+
"prepare": "rm -f .husky/pre-commit && husky install && npx husky add .husky/pre-commit \"npx lint-staged && git add .\" && chmod +x .husky/pre-commit",
1313
"dev": "vuepress dev docs",
1414
"build": "vuepress build docs",
1515
"build:proxy": "./scripts/bundle build_proxy",
@@ -40,6 +40,7 @@
4040
"eslint-plugin-promise": "^6.1.1",
4141
"eslint-plugin-vue": "^9.17.0",
4242
"husky": "^8.0.3",
43+
"lint-staged": "^15.0.2",
4344
"markdownlint-cli": "^0.37.0",
4445
"markmap-cli": "^0.15.4",
4546
"shelljs": "^0.8.5",

pnpm-lock.yaml

Lines changed: 87 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)