Skip to content

Commit 569fe62

Browse files
committed
workflow: format code when commit
1 parent 244e902 commit 569fe62

File tree

2 files changed

+407
-0
lines changed

2 files changed

+407
-0
lines changed

package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,18 @@
3636
"build-preview": "vite build -c vite.preview.config.ts",
3737
"format": "prettier --write .",
3838
"release": "bumpp -r",
39+
"preinstall": "npx only-allow pnpm",
40+
"postinstall": "simple-git-hooks",
3941
"prepublishOnly": "npm run build && npm run build-types"
4042
},
43+
"simple-git-hooks": {
44+
"pre-commit": "pnpm exec lint-staged --concurrent false"
45+
},
46+
"lint-staged": {
47+
"*": [
48+
"prettier --write --cache --ignore-unknown"
49+
]
50+
},
4151
"repository": {
4252
"type": "git",
4353
"url": "git+https://github.com/vuejs/repl.git"
@@ -63,13 +73,15 @@
6373
"codemirror": "^5.65.13",
6474
"fflate": "^0.8.0",
6575
"hash-sum": "^2.0.0",
76+
"lint-staged": "^13.2.3",
6677
"monaco-editor-core": "^0.38.0",
6778
"monaco-editor-textmate": "^4.0.0",
6879
"monaco-textmate": "^3.0.1",
6980
"monaco-volar": "^0.4.0",
7081
"onigasm": "^2.2.5",
7182
"path-browserify": "^1.0.1",
7283
"prettier": "^2.8.8",
84+
"simple-git-hooks": "^2.8.1",
7385
"sucrase": "^3.32.0",
7486
"typescript": "^5.1.3",
7587
"vite": "^4.3.9",

0 commit comments

Comments
 (0)