JSPM

commitlint-config-emoji-convention

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 15
  • Score
    100M100P100Q53169F
  • License MIT

Shareable commitlint configuration that enforces conventional commits and adds emoji support

Package Exports

  • commitlint-config-emoji-convention
  • commitlint-config-emoji-convention/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (commitlint-config-emoji-convention) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

commitlint-config-emoji-convention

npm latest download MIT

Shareable commitlint configuration that enforces conventional commits and adds emoji support. Use with commitlint.

Getting Started

npm install --save-dev @commitlint/cli commitlint-config-emoji-convention

echo "export default { extends: ['emoji-convention'] }" > commitlint.config.js

The official commitlint documentation recommends using Husky to validate commit messages.

npm install --save-dev husky
npx husky init

echo "npx --no -- commitlint --edit \$1" > .husky/commit-msg

The above configuration will validate commit messages, but requires manual emoji inclusion. To automatically prepend emojis based on commit prefixes, perform the following steps:

touch .husky/prepare-commit-msg

Add the following script:

msg=$(cat "$1")

msg=$(echo $msg | sed -e "s/^init/🎉 init/")
msg=$(echo $msg | sed -e "s/^feat/✨ feat/")
msg=$(echo $msg | sed -e "s/^fix/🐛 fix/")
msg=$(echo $msg | sed -e "s/^docs/📚 docs/")
msg=$(echo $msg | sed -e "s/^style/💎 style/")
msg=$(echo $msg | sed -e "s/^refactor/📦 refactor/")
msg=$(echo $msg | sed -e "s/^perf/🚀 perf/")
msg=$(echo $msg | sed -e "s/^test/🚨 test/")
msg=$(echo $msg | sed -e "s/^build/🛠 build/")
msg=$(echo $msg | sed -e "s/^ci/⚙️ ci/")
msg=$(echo $msg | sed -e "s/^chore/♻️ chore/")
msg=$(echo $msg | sed -e "s/^revert/🗑 revert/")

echo $msg > $1

Format

<emoji> <type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>

Examples

✨ feat(blog): add comment section
🐛 fix: resolve null pointer exception
📚 docs(README): add contribution guidelines

- Added code of conduct
- Updated PR template

Issue: #123

Rules

Commit message rules follow the Conventional Commits specification.

Supported commit types:

  • 🎉 init: Project initialization
  • ✨ feat: A new feature
  • 🐛 fix: A bug fix
  • 📚 docs: Documentation only changes
  • 💎 style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • 📦 refactor: A code change that neither fixes a bug nor adds a feature
  • 🚀 perf: A code change that improves performance
  • 🚨 test: Adding missing tests or correcting existing tests
  • 🛠 build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ⚙️ ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • ♻️ chore: Other changes that don't modify src or test files
  • 🗑 revert: Reverts a previous commit

Credits

License

MIT © João Vitor