English | δΈζ
Shareable commitlint config enforcing gitmoji.
Use with @commitlint/cli and @commitlint/prompt-cli.
install commitlint and commit-config-gitmoji
# For Windows:
npm install --save-dev @ballcat/commitlint-config-gitmoji @commitlint/cli
# Configure commitlint to use conventional config
echo "module.exports = {extends: ['./node_modules/@ballcat/commitlint-config-gitmoji']}" > commitlint.config.jsTo lint commits before they are created you can use Husky's commit-msg hook:
install husky v8
npx husky-init && npm install # npm
npx husky-init && yarn # Yarn 1
yarn dlx husky-init --yarn2 && yarn # Yarn 2+
pnpm dlx husky-init && pnpm install # pnpmadd hook
npx husky add .husky/commit-msg 'npx --no -- commitlint --edit "$1"'
<type> [scope] <subject>
[body]
[footer]
type(required): An emoji from the list.scope(optional): A string wrapped in parentheses that adds contextual information for the scope of the change.subject(required): A brief explanation of the change.body(required): Detailed description of the change.footer(required): Links and operation issues or PR, eg.Closes #392
The following rules are considered problems for @ballcat/commit-config-gitmoji and will yield a non-zero exit code when not met.
Consult docs/rules for a list of available rules.
- condition:
typeis found in value - rule:
always - level:
error - value: emoji code list, see gitmoji list
echo ":no: some message" # fails
echo ":bug: some message" # passes- description:
typeis in casevalue - rule:
always - level:
error - value
'lowerCase'
echo ":BUG: some message" # fails
echo ":bug: some message" # passes- condition:
typeis empty - rule:
never - level:
error
echo "some message" # fails
echo ":bug: some message" # passes- condition:
subjectis in one of the cases['sentence-case', 'start-case', 'pascal-case', 'upper-case'] - rule:
always - level:
error
echo ":bug: Some message" # fails
echo ":bug: Some Message" # fails
echo ":bug: SomeMessage" # fails
echo ":bug: SOMEMESSAGE" # fails
echo ":bug: some message" # passes
echo ":bug: some Message" # passes- condition:
subjectis empty - rule:
never - level:
error
echo ":bug:" # fails
echo ":bug: some message" # passes- condition:
subjectends withvalue - rule:
never - level:
error - value
'.'
echo ":bug: some message." # fails
echo ":bug: some message" # passes- condition:
headerhasvalueor less characters - rule:
always - level:
error - value
72
echo ":bug: some message that is way too long and breaks the line max-length by several characters" # fails
echo ":bug: some message" # passes- condition:
footershould have a leading blank line - rule:
always - level:
error
echo ":bug: some message
BREAKING CHANGE: It will be significant" # error
echo ":bug: some message
BREAKING CHANGE: It will be significant" # passes- condition:
bodyshould have a leading blank line - rule:
always - level:
error
echo ":bug: some message
body" # error
echo ":bug: some message
body" # passessee gitmojis.json or gitmoji.dev
| Emoji | Emoji code | Description |
|---|---|---|
| π¨ | :art: |
Improve structure / format of the code. |
| β‘οΈ | :zap: |
Improve performance. |
| π₯ | :fire: |
Remove code or files. |
| π | :bug: |
Fix a bug. |
| π | :ambulance: |
Critical hotfix. |
| β¨ | :sparkles: |
Introduce new features. |
| π | :memo: |
Add or update documentation. |
| π | :rocket: |
Deploy stuff. |
| π | :lipstick: |
Add or update the UI and style files. |
| π | :tada: |
Begin a project. |
| β | :white_check_mark: |
Add, update, or pass tests. |
| π | :lock: |
Fix security issues. |
| π | :closed_lock_with_key: |
Add or update secrets. |
| π | :bookmark: |
Release / Version tags. |
| π¨ | :rotating_light: |
Fix compiler / linter warnings. |
| π§ | :construction: |
Work in progress. |
| π | :green_heart: |
Fix CI Build. |
| β¬οΈ | :arrow_down: |
Downgrade dependencies. |
| β¬οΈ | :arrow_up: |
Upgrade dependencies. |
| π | :pushpin: |
Pin dependencies to specific versions. |
| π· | :construction_worker: |
Add or update CI build system. |
| π | :chart_with_upwards_trend: |
Add or update analytics or track code. |
| β»οΈ | :recycle: |
Refactor code. |
| β | :heavy_plus_sign: |
Add a dependency. |
| β | :heavy_minus_sign: |
Remove a dependency. |
| π§ | :wrench: |
Add or update configuration files. |
| π¨ | :hammer: |
Add or update development scripts. |
| π | :globe_with_meridians: |
Internationalization and localization. |
| βοΈ | :pencil2: |
Fix typos. |
| π© | :poop: |
Write bad code that needs to be improved. |
| βͺοΈ | :rewind: |
Revert changes. |
| π | :twisted_rightwards_arrows: |
Merge branches. |
| π¦οΈ | :package: |
Add or update compiled files or packages. |
| π½οΈ | :alien: |
Update code due to external API changes. |
| π | :truck: |
Move or rename resources (e.g.: files, paths, routes). |
| π | :page_facing_up: |
Add or update license. |
| π₯ | :boom: |
Introduce breaking changes. |
| π± | :bento: |
Add or update assets. |
| βΏοΈ | :wheelchair: |
Improve accessibility. |
| π‘ | :bulb: |
Add or update comments in source code. |
| π» | :beers: |
Write code drunkenly. |
| π¬ | :speech_balloon: |
Add or update text and literals. |
| ποΈ | :card_file_box: |
Perform database related changes. |
| π | :loud_sound: |
Add or update logs. |
| π | :mute: |
Remove logs. |
| π₯ | :busts_in_silhouette: |
Add or update contributor(s). |
| πΈ | :children_crossing: |
Improve user experience / usability. |
| ποΈ | :building_construction: |
Make architectural changes. |
| π± | :iphone: |
Work on responsive design. |
| π€‘ | :clown_face: |
Mock things. |
| π₯ | :egg: |
Add or update an easter egg. |
| π | :see_no_evil: |
Add or update a .gitignore file. |
| πΈ | :camera_flash: |
Add or update snapshots. |
| βοΈ | :alembic: |
Perform experiments. |
| ποΈ | :mag: |
Improve SEO. |
| π·οΈ | :label: |
Add or update types. |
| π± | :seedling: |
Add or update seed files. |
| π© | :triangular_flag_on_post: |
Add, update, or remove feature flags. |
| π₯ | :goal_net: |
Catch errors. |
| π« | :dizzy: |
Add or update animations and transitions. |
| ποΈ | :wastebasket: |
Deprecate code that needs to be cleaned up. |
| π | :passport_control: |
Work on code related to authorization, roles and permissions. |
| π©Ή | :adhesive_bandage: |
Simple fix for a non-critical issue. |
| π§ | :monocle_face: |
Data exploration/inspection. |
| β°οΈ | :coffin: |
Remove dead code. |
| π§ͺ | :test_tube: |
Add a failing test. |
| π | :necktie: |
Add or update business logic |
| π©Ί | :stethoscope: |
Add or update healthcheck. |
| π§± | :bricks: |
Infrastructure related changes. |
| π§βπ» | :technologist: |
Improve developer experience |
| πΈ | :money_with_wings: |
Add sponsorships or money related infrastructure. |
| π§΅ | :thread: |
Add or update code related to multithreading or concurrency. |