@bigcommerce/validate-commits

中文文档
2.3.6发布于 2026/06/12MIT近 30 天下载 9953

Validates commits based on a series of scopes/tasks

原始使用文档
文档目录7 节
  1. Installation
  2. Usage
  3. Tasks
  4. Scopes
  5. CLI
  6. Requirements
  7. License

@bigcommerce/validate-commits

This is a tool for validating commit messages - to ensure they have a consistent format and the required information.

Installation

npm install --save-dev @bigcommerce/validate-commits

Usage

Your commit message needs to have the following format:

task(scope): JIRA-1234 My commit message

You might also want to include a message body to provide additional information, for example, a breaking change.

task(scope): JIRA-1234 My commit message

BREAKING CHANGE: ABC has been renamed to XYZ.

Tasks

Below is a list of supported tasks:

  • feat: A new feature
  • fix: A bug fix
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • refactor: A code change that neither fixes a bug nor adds a feature
  • perf: A code change that improves performance
  • test: Adding missing or correcting existing tests
  • chore: Changes to the build process or auxiliary tools and libraries such as documentation generation

Scopes

You need to add commit-validation.json to the root of your project in order to configure a list of supported scopes. i.e.:

{
    "scopes": [
        "payment",
        "checkout",
        "orders"
    ]
}

CLI

To run the validator in Terminal:

npx validate-commits

Requirements

  • Node: >=22

License

MIT

版本与发布记录

@bigcommerce/validate-commits 共发布 14 个版本,首次发布于 2018/04/27;过去 12 个月发布了 2 个版本。

版本发布日期距今
2.3.6latest2026/06/124 个月前
2.3.52026/03/117 个月前
2.3.42024/01/152 年前
2.3.32023/07/133 年前
2.3.22022/08/294 年前
2.3.12022/08/264 年前

关于 @bigcommerce/validate-commits 的常见问题

@bigcommerce/validate-commits 是什么?

Validates commits based on a series of scopes/tasks

如何安装 @bigcommerce/validate-commits?

在项目目录运行 npm install @bigcommerce/validate-commits,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 validate-commits,可以用 npx validate-commits 直接运行。

@bigcommerce/validate-commits 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/bigcommerce__validate-commits 是否存在。

@bigcommerce/validate-commits 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@bigcommerce/validate-commits 可以商用吗?

@bigcommerce/validate-commits 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@bigcommerce/validate-commits 的下载量有多少?

根据 npm 官方下载统计,@bigcommerce/validate-commits 在 2026/10/08 – 2026/11/06 这 30 天内被下载 9,953 次,日均约 332 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bigcommerce/validate-commits 还在维护吗?

最新版本 2.3.6 发布于 2026/06/12(4 个月前);至今共发布 14 个版本,其中过去 12 个月发布了 2 个;首次发布于 2018/04/27。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。