chore: lefthook config

pull/348/MERGE
xingyu4j 2026-05-19 15:54:03 +08:00
parent a4dd9d30ce
commit 454a5b54bd
1 changed files with 7 additions and 20 deletions

View File

@ -44,33 +44,20 @@
pre-commit: pre-commit:
parallel: true parallel: true
commands: commands:
code-workspace: install:
run: pnpm vsh code-workspace --auto-commit run: pnpm install
lint-md:
run: pnpm oxfmt {staged_files}
glob: '*.md'
lint-vue:
run: pnpm oxfmt {staged_files} && pnpm oxlint --fix --no-error-on-unmatched-pattern {staged_files} && pnpm eslint --cache --fix {staged_files} && pnpm stylelint --fix --allow-empty-input {staged_files}
glob: '*.vue'
lint-js:
run: pnpm oxfmt {staged_files} && pnpm oxlint --fix --no-error-on-unmatched-pattern {staged_files} && pnpm eslint --cache --fix {staged_files}
glob: '*.{js,jsx,ts,tsx}'
lint-style:
run: pnpm oxfmt {staged_files} && pnpm stylelint --fix --allow-empty-input {staged_files}
glob: '*.{scss,less,styl,html,vue,css}'
lint-package:
run: pnpm oxfmt {staged_files}
glob: 'package.json'
lint-json:
run: pnpm oxfmt {staged_files}
glob: '{!(package)*.json,*.code-snippets,.!(browserslist)*rc}'
post-merge: post-merge:
commands: commands:
install: install:
run: pnpm install run: pnpm install
lint:
run: pnpm lint
checkType:
run: pnpm check:type
commit-msg: commit-msg:
commands: commands:
commitlint: commitlint:
run: pnpm exec commitlint --edit $1 run: pnpm exec commitlint --edit $1