Husky + lint-staged からLefthookへ移行する
- 投稿した日
- 更新した日
- 書いたひと
- ひらたけ
- Introduction - Lefthook Documentation
- evilmartians/lefthook: Fast and powerful Git hooks manager for any type of projects.
環境
- Husky - 9.1.7
- lint-staged - 15.3.0
Husky と lint-staged をアンインストールする
$ pnpm remove husky lint-staged
$ git config --unset core.hooksPath
Lefthook をインストールする
$ pnpm add -D lefthook
pre-commit:
parallel: true
commands:
linter:
glob: '*.{js,ts,jsx,tsx,cjs,cts,mjs,mts,vue}'
run: pnpm eslint --fix {staged_files}
stage_fixed: true
formatter:
glob: '*.{html,css,scss,js,ts,jsx,tsx,cjs,cts,mjs,mts,vue,json,yml,yaml}'
run: pnpm prettier -w {staged_files}
stage_fixed: true
commit-msg:
commands:
commitlint:
run: pnpm commitlint --edit {1}