LinuxmacOSWindows

Where Is the commitlint Config File?

commitlint reads commitlint.config.js at the repo root, extending shared configs for message rules.

Last updated

commitlint configures from a config file at the repository root. The file extends a shared preset like conventional commits and tweaks individual rules. Husky or CI invokes it against each message.

Filename variants include .commitlintrc flavors in JSON or YAML. Rules version with the preset package, so pin both together. Local overrides stay minimal while the shared config carries team standards.

Where commitlint stores this, by platform

Linux
[Repo]/commitlint.config.js

Extends and rule tweaks live here. Runs through hooks or CI per commit. Variants like .commitlintrc resolve the same way.

macOS
[Repo]/commitlint.config.js

Same root file on Mac. GUI commit tools respect it through hooks. Keep preset versions pinned in package.json.

Windows
[Repo]\commitlint.config.js

Same file on Windows. Message encoding quirks surface here first. Test rules with the lint command on samples.

Frequently asked questions

How do I allow a custom commit type?

Extend the type enum rule in the config with the extra value. Keep the shared preset underneath. Document the type for the team.

Why does CI reject valid looking messages?

Preset versions differ between local and CI installs. Pin matching versions on both sides. Check body and footer rules beyond the subject.

Notice an outdated path? Let us know.