Introduction

Lefthook is a Git hooks manager. This documentation provides the reference for installing, configuring and using the lefthook.

Example: Run your linters on pre-commit hook and forget about the routine.

# lefthook.yml

pre-commit:
  parallel: true
  jobs:
    - run: yarn run stylelint --fix {staged_files}
      glob: "*.css"
      stage_fixed: true

    - run: yarn run eslint --fix "{staged_files}"
      glob:
        - "*.ts"
        - "*.js"
        - "*.tsx"
        - "*.jsx"
      stage_fixed: true

Sponsored by Evil Martians

If you have a question or found a mistake in the documentation, please create a new discussion. Small contributions help maintaining the quality of the project.