Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

commitlint

Package Overview
Dependencies
Maintainers
4
Versions
126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commitlint

Lint your commit messages

  • 19.6.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
382K
increased by2.51%
Maintainers
4
Weekly downloads
 
Created

What is commitlint?

commitlint is an npm package used to enforce conventional commit messages. It helps teams maintain a consistent commit history by validating commit messages against a set of rules.

What are commitlint's main functionalities?

Basic Configuration

This feature allows you to set up commitlint with a basic configuration that extends the conventional commit rules. This ensures that your commit messages follow a standard format.

{
  "extends": ["@commitlint/config-conventional"]
}

Custom Rules

You can define custom rules for commit messages. In this example, the 'type-enum' rule enforces that the commit type must be one of the specified values, and the 'subject-case' rule ensures that the commit message subject is not in sentence case.

{
  "rules": {
    "type-enum": [2, "always", ["feat", "fix", "docs", "style", "refactor", "test", "chore"]],
    "subject-case": [2, "never", ["sentence-case"]]
  }
}

Linting Commit Messages

This command lints the commit message that is being edited. It is typically used in a Git hook to automatically validate commit messages before they are finalized.

npx commitlint --edit $1

Integrating with Husky

commitlint can be integrated with Husky to automatically run commit message linting as a Git hook. This ensures that all commit messages are validated before they are committed.

{
  "husky": {
    "hooks": {
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
    }
  }
}

Other packages similar to commitlint

Keywords

FAQs

Package last updated on 19 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc