🚦 Lint your gitmoji commits
commitlint-config-gitmoji
Shareable commitlint
config enforcing gitmoji commit message styles. Use with commitlint .
Demo
TODO
Getting started
Install
Install dependencies
npm i -D commitlint-config-gitmoji commitlint
or
# use pnpm
pnpm i -D commitlint-config-gitmoji commitlint
Config
Add commitlint config for Gitmoji
echo "module.exports = {extends: ['gitmoji']};" > commitlint.config.js
Commit style
Structure
the Gitmoji Structure of commit styles is below
:gitmoji: type(scope?): subject
body?
footer?
Example
:sparkles: feat(changelog): support chinese title
:bug: fix(config): fix a subject bug
:memo: docs: update README.md
:bulb: docs(plugin): update comments
Detail Rules
Problems
The following rules are considered problems for gitmoji commit
and will yield a non-zero exit code when not met.
Consult docs/rules for a list of available rules.
type-enum
echo ":abc: some message"
echo ":feat: some message"
type-case
- description:
type
is in case value
- rule:
always
- value:
lowerCase
echo ":ART: Format some code"
echo ":art: Format some code"
type-empty
- condition:
type
is empty - rule:
never
echo ": some message"
echo ":fire: Delete some file"
scope-case
- condition:
scope
is in case value
- rule:
always
- value:
lowerCase
echo ":art:(SCOPE) some message"
echo ":art:(scope) some message"
subject-case
- condition:
subject
must begin with ['sentence-case', 'start-case', 'pascal-case', 'upper-case']
- rule:
always
echo ":art:(scope) Some Message"
echo ":art:(scope) some message"
subject-empty
- condition:
subject
is empty - rule:
never
echo ":art: "
echo ":art: some message"
subject-full-stop
- condition:
subject
ends with value
- rule:
never
- value:
.
echo ":art: some message."
echo ":art: some message"
- condition:
header
has value
or less characters - rule:
always
- value:
100
echo ":art: some message that is way too long and breaks the line max-length by several characters"
echo ":art: some message"
License
MIT ® Arvin Xu