JSPM

  • Created
  • Published
  • Downloads 29827
  • Score
    100M100P100Q155396F
  • License MIT

shareable commitlint config enforcing gitmoji commit message

Package Exports

  • commitlint-config-gitmoji
  • commitlint-config-gitmoji/lib/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-gitmoji) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

🚦 Lint your gitmoji commits

commitlint-config-gitmoji

NPM version NPM downloads

Shareable commitlint config enforcing gitmoji commit message styles. Use with commitlint .

Demo

TODO

Getting started

Install

Install dependencies

# use npm
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

✨ feat(changelog): support chinese title

🐛 fix(config): fix a subject bug

📝 docs: update README.md

💡 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 "🔤 some message" # fails
echo ":feat: some message" # passes

type-case

  • description: type is in case value
  • rule: always
  • value: lowerCase
echo ":ART: Format some code" # fails
echo "🎨 Format some code" # passes

type-empty

  • condition: type is empty
  • rule: never
echo ": some message" # fails
echo "🔥 Delete some file" # passes

scope-case

  • condition: scope is in case value
  • rule: always
  • value: lowerCase
echo "🎨(SCOPE) some message" # fails
echo "🎨(scope) some message" # passes

subject-case

  • condition: subject must begin with ['sentence-case', 'start-case', 'pascal-case', 'upper-case']
  • rule: always
echo "🎨(scope) Some Message" # pass
echo "🎨(scope) some message" # Fails

subject-empty

  • condition: subject is empty
  • rule: never
echo "🎨 " # fails
echo "🎨 some message" # passes

subject-full-stop

  • condition: subject ends with value
  • rule: never
  • value: .
echo "🎨 some message." # fails
echo "🎨 some message" # passes

header-max-length

  • condition: header has value or less characters
  • rule: always
  • value: 100
echo "🎨 some message that is way too long and breaks the line max-length by several characters" # fails
echo "🎨 some message" # passes

License

MIT ® Arvin Xu