1.0.9 • Published 10 days ago

@gcoguiec/commitlint-config v1.0.9

Weekly downloads
-
License
BSD-2-Clause
Repository
github
Last release
10 days ago

Table of Contents

Convention

  • A commit type is always lowercased and must be provided at all-time.
  • The scope is optional but must be lowercased if used.
  • Like a sentence: a commit subject must be capitalized and ends with a period.
  • The message body and footer should start with a leading blank line.
  • A line can't exceed 100 characters.

Getting Started

Install the development dependency:

pnpm add -D @gcoguiec/commitlint-config

And simply add a .commitlintrc.js file at the project root:

module.exports = {
  extends: ['@gcoguiec/commitlint-config']
};

Examples

git commit -m "bootstrap: Initial commit." # passes
git commit -m "ci: Set-up GitHub actions." # passes
git commit -m "style: Fix assets (logo). [#123]" # passes
git commit -m "Initial commit." # fails: no commit type.
git commit -m "bootstrap: Initial commit" # fails: no full-stop.
git commit -m "unknown: Initial commit." # fails: commit type doesn't exists.

Commit Types

TypeDescription 
a11y♿️ Changes regarding accessibility or inclusivity.
bootstrap🎉 bootstrap: Initial commit.
build🏗️ Changes that affect the build system.
chore or cleanup🧹 A chore or cleanup, usually to keep the project tidy.
ci👷 Changes to the CI configuration files and scripts.
config⚙️ Changes that affect the project configurations.
deps⬆️ Changes regarding dependencies (upgrade, downgrade)
docs📖 A modification or addition to the documentation.
feat✨ A new feature.
fix🐛 A bug fix.
i18n⛳️ An internationalization change.
perf⏱️ A performance improvement.
refactor ♻️ A code refactor.
refine🧪 A code experiment or a feature refinement.
release🔖 A release.
revert⏪️ A commit revert (revert(fbb6553))
security🔒️ A security fix or improvement.
style💄 A style change (could be assets or code formatting).
test✅ A test suite change.
wipCan be used inside a development branch or simply use -n or --no-verify to your git commit call to skip the hooks.

Specifying Scopes

// .commitlintrc.cjs
module.exports = {
  extends: ['@gcoguiec/commitlint-config'],
  rules: {
    'scope-enum': [
      2,
      'always',
      [
        // i.e: application component scopes
        'auth',
        'billing'
        // or package names in a monorepo context
        'eslint-config-base',
        'eslint-config-react'
      ]
    ]
  }
};
git commit -m 'feat(billing): Update sales tax strategy.'
git commit -m 'deps(eslint-config-react): Bump dependencies.'

License

This project is licensed under BSD 2-Clause.

1.0.9

10 days ago

1.0.8

2 months ago

1.0.6

6 months ago

1.0.5

6 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago