You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@commitlint/cli

Package Overview
Dependencies
7
Maintainers
4
Versions
138
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commitlint/cli

Lint your commit messages


Version published
Maintainers
4
Created

Package description

What is @commitlint/cli?

The @commitlint/cli package is a command-line tool that helps enforce conventions on commit messages. It allows teams to follow a predefined set of rules for commit messages, ensuring consistency and readability across the project's history. This is particularly useful in projects that use semantic versioning or need to generate changelogs automatically.

What are @commitlint/cli's main functionalities?

Linting Commit Messages

This command lints the commit message found in the file that `--edit` points to (defaults to the last commit message). It checks the message against the configured commitlint rules and returns errors or warnings based on those rules.

commitlint --edit

Configuring Commitlint

This code snippet shows how to configure commitlint in a project. It uses the `config-conventional` preset, which enforces conventional commit message guidelines. This configuration is typically placed in a `commitlint.config.js` file at the root of the project.

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

Integrating with Husky for Git Hooks

This JSON configuration integrates commitlint with Husky, a tool for managing Git hooks. It sets up a `commit-msg` hook that runs commitlint against commit messages, using the `HUSKY_GIT_PARAMS` environment variable to pass the commit message file path to commitlint. This ensures that all commit messages are linted before they are finalized.

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

Other packages similar to @commitlint/cli

Changelog

Source

19.3.0 (2024-04-23)

Bug Fixes

  • update dependency inquirer to v9.2.19 (#4031) (84126c1)

Features

  • container: added @commitlint/config-nx-scopes for nx monorepos (#3913) (aa4df36)
  • format: print full commit message for valid commits if -V (#4026) (a7bbc49)

Readme

Source

@commitlint/cli

Lint commit messages

Documentation

Consult CLI reference for comprehensive documentation.

Keywords

FAQs

Package last updated on 23 Apr 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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc