Introduction
Lefthook is a Git hooks manager. This documentation provides the reference for installing, configuring and using the lefthook.
-
Installation instructions to install lefthook to your OS or project.
-
Examples of lefthook common usage.
-
Configuration with detailed explanation of lefthook options.
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
❓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.