Create FasterCreate Faster

Husky

Husky is a Git hooks manager that lets you run scripts at key moments in the Git workflow for quality assurance.

→ Husky Documentation

Requires: Git repository and a linter

What create-faster adds

Beyond the official setup, we include:

Two Git Hooks:

  1. Pre-commit - Runs lint-staged on the staged files
  2. Commit-msg - Checks the conventional commit format

lint-staged:

  • The tasks come from the linter you chose: biome check --write, eslint --fix, prettier --write, or oxlint --fix followed by oxfmt
  • In a turborepo with ESLint, each app and package carries its own lint-staged entry, so a staged file is linted with the configuration of its own workspace
  • The prepare script runs husky on 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 format

Pre-Commit Hook:

# Runs lint-staged: the linter tasks on the staged files

Commit-Msg Hook:

# Checks: <type>(<scope>): <subject>
# Example: feat(auth): add email login
# Prints a warning with the format and the types if invalid

On this page