@carlos3g/commitlint-config
Shared commitlint config — the commit-message half
of carlos3g's code style.
Conventional Commits: English,
imperative, lowercase.
yarn add -D @carlos3g/commitlint-config @commitlint/cli
Reference it from .commitlintrc.json:
{
"extends": ["@carlos3g/commitlint-config"]
}
Then wire it into a commit-msg git hook (e.g. with
husky):
npx --no -- commitlint --edit "$1"
What it sets
Re-exports @commitlint/config-conventional.
The indirection exists so every project references one versioned source — and
so project-wide rule tweaks happen here, once.
What that enforces on every commit:
type(scope): subject with a type from build, chore, ci, docs,
feat, fix, perf, refactor, revert, style, test.
- A lowercase subject —
Sentence case, Start Case, PascalCase and
UPPER CASE subjects are rejected — with no trailing period.
- Header and body lines of at most 100 characters.
English and the imperative mood (add, not added) are part of the
convention, but no lint rule can check them — they are on the author and the
reviewer.
License
MIT © carlos3g