Husky
Husky is a Git hooks manager that lets you run scripts at key moments in the Git workflow for quality assurance.
Requires: Git repository and a linter
What create-faster adds
Beyond the official setup, we include:
Two Git Hooks:
- Pre-commit - Runs lint-staged on the staged files
- Commit-msg - Checks the conventional commit format
lint-staged:
- The tasks come from the linter you chose:
biome check --write,eslint --fix,prettier --write, oroxlint --fixfollowed byoxfmt - In a turborepo with ESLint, each app and package carries its own
lint-stagedentry, so a staged file is linted with the configuration of its own workspace - The
preparescript runshuskyon install, which activates the hooks
Conventional Commits Check:
- Expects
<type>(<scope>): <subject>on the first line - Accepted types:
feat,fix,docs,style,refactor,perf,test,build,ci,chore,revert,workflow,wip,security - Example:
feat(auth): add email login - Prints one verdict: the message is valid, or a warning that lists the format and the types
- Never blocks the commit (warning, not error)
Files created:
.husky/
├── pre-commit # Run lint-staged
└── commit-msg # Check the conventional commit formatPre-Commit Hook:
# Runs lint-staged: the linter tasks on the staged filesCommit-Msg Hook:
# Checks: <type>(<scope>): <subject>
# Example: feat(auth): add email login
# Prints a warning with the format and the types if invalid
