lefthook.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. pre-commit:
  2. parallel: true
  3. commands:
  4. lint-md:
  5. run: pnpm prettier --cache --ignore-unknown --write {staged_files}
  6. glob: '*.md'
  7. lint-vue:
  8. run: pnpm prettier --write {staged_files} && pnpm eslint --cache --fix {staged_files} && pnpm stylelint --fix --allow-empty-input {staged_files}
  9. glob: '*.vue'
  10. lint-js:
  11. run: pnpm prettier --cache --ignore-unknown --write {staged_files} && pnpm eslint --cache --fix {staged_files}
  12. glob: '*.{js,jsx,ts,tsx}'
  13. lint-style:
  14. run: pnpm prettier --cache --ignore-unknown --write {staged_files} && pnpm stylelint --fix --allow-empty-input {staged_files}
  15. glob: '*.{scss,less,styl,html,vue,css}'
  16. lint-package:
  17. run: pnpm prettier --cache --write {staged_files}
  18. glob: 'package.json'
  19. lint-json:
  20. run: pnpm prettier --cache --write --parser json {staged_files}
  21. glob: '{!(package)*.json,*.code-snippets,.!(browserslist)*rc}'
  22. post-merge:
  23. commands:
  24. install:
  25. run: pnpm install
  26. commit-msg:
  27. commands:
  28. commitlint:
  29. run: pnpm exec commitlint --edit $1