
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
commitlint
Advanced tools
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.
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"
}
}
}
cz-customizable is a package that provides a customizable commitizen adapter. It helps in creating consistent commit messages by providing a guided commit message prompt. Unlike commitlint, which validates commit messages after they are written, cz-customizable helps in writing them correctly in the first place.
commitizen is a tool that helps you write commit messages following the conventional commit format. It provides an interactive CLI to guide you through the commit message creation process. While commitlint focuses on validating commit messages, commitizen focuses on creating them.
semantic-release automates the versioning and package publishing process based on the commit messages. It uses commit message conventions to determine the type of release (major, minor, patch). While commitlint ensures commit message consistency, semantic-release uses those messages to automate releases.
Alias of @commitlint/cli
FAQs
Lint your commit messages
The npm package commitlint receives a total of 312,400 weekly downloads. As such, commitlint popularity was classified as popular.
We found that commitlint demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.