Skip to content

Latest commit

 

History

History
84 lines (59 loc) · 1.68 KB

README.md

File metadata and controls

84 lines (59 loc) · 1.68 KB

@itaober/commitlint

English / 简体中文

Introduction

@itaober/commitlint provides a set of predefined Commitlint configurations to help standardize commit messages and supports command-line prompt suggestions.

Install

pnpm install @itaober/commitlint -D

Usage

Commitlint Configuration File

Refer to the Commitlint official configuration documentation.

ESM

/** @type {import("@itaober/commitlint").UserConfig} */
export default {
  extends: ['@itaober/commitlint'],
  // Add your custom configurations here
};

CJS

/** @type {import("@itaober/commitlint").UserConfig} */
module.exports = {
  extends: ['@itaober/commitlint'],
  // Add your custom configurations here
};

commit-msg hook lint

Validate commit messages against commitlint rules before each commit. Follow these steps:

  1. Install the dependencies
pnpm add simple-git-hooks -D
  1. Add the following code to your package.json
{
  "simple-git-hooks": {
    "commit-msg": "npx --no-install commitlint --edit $1"
  }
}

prompt suggestions (optional)

@itaober/commitlint includes @commitlint/cz-commitlint and commitizen, supporting command-line prompt suggestions for commit messages. To enable this feature, follow these steps:

  1. Add the following code to your package.json
{
  "scripts": {
    "cz": "git-cz"
  },
  "config": {
    "commitizen": {
      "path": "@commitlint/cz-commitlint"
    }
  }
}
  1. After git add, run pnpm cz to create a commit message with prompt suggestions.

Changelog

See the CHANGELOG.md.