Skip to content

Stage and commit

Git determines what goes into a commit. Stage the changes you want first, then choose either a guided prompt or a message you write yourself.

Terminal window
git add src/example.ts
npx lintlane commit
Command Result
npx lintlane commit Start Commitizen’s guided prompt and create a commit.
npx lintlane c Alias for commit.
npx lintlane commit --dry-run Use Commitizen’s dry-run mode without creating a commit.
npx lintlane commit --retry Reuse the last message after a failed commit.
npx lintlane commit -a Stage tracked changes before committing.
npx lintlane commit --signoff Add a sign-off through Commitizen.
npx lintlane commit -- -n Pass Git’s hook bypass option for this commit.
npx lintlane commit -- -S Pass -S to Git to sign the commit.
git commit Use the hook-based guided prompt when eligible.
git commit -m "feat: add search" Supply a message directly; commitlint still validates it.

Arguments after -- go to Git. Commitizen’s --signoff and Git’s signing option -- -S have different purposes.

The hook sequence during a normal commit is:

  1. pre-commit → lint-staged → Biome: check and fix staged files using the configured lint-staged tasks. Its default task is biome check --write --no-errors-on-unmatched --files-ignore-unknown=true. lint-staged manages partially staged files and restores state when tasks fail.
  2. prepare-commit-msg → Commitizen, when needed: prompt on a plain git commit. Skip the prompt for a supplied message, merge, amend, CI, Windows, missing terminal, or LINTLANE_NO_PROMPT=1. With lintlane commit, the guided message has already been collected.
  3. commit-msg → commitlint: validate the completed message; reject the commit if it violates the configured rules.

Commitizen helps compose the message; commitlint enforces the rules. Optional lintlane.commit settings such as types, messageLengthLimit, and allowedPrefixes affect Lintlane’s commitlint preset. Customize the Commitizen adapter separately to change the prompt.

feat(search): add keyboard navigation
fix: preserve partially staged changes
chore: update development dependencies

The type describes the kind of change, the optional scope identifies the area, and the description explains the change. Commitizen helps you assemble these fields; commitlint checks the resulting message against your configured rules.

Rules come from commitlint.config.mjs, which by default is export { default } from "lintlane/commitlint": Conventional Commits, plus the optional block below. Replace the file with your own config any time.

{
"lintlane": {
"commit": {
"types": ["feat", "fix", "chore"],
"messageLengthLimit": 72,
"allowedPrefixes": ["WIP"]
}
}
}

The guided prompt is Commitizen’s standard cz-conventional-changelog (config.commitizen.path = "lintlane/presets/commitizen.cjs"); configure it like any Commitizen adapter.

Validate history and push