JSPM

commitlint-config-ali

0.1.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 478
  • Score
    100M100P100Q95219F
  • License MIT

Commitlint shareable configuration for Alibaba F2E Guidelines

Package Exports

  • commitlint-config-ali

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (commitlint-config-ali) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

commitlint-config-ali

本包提供了《阿里巴巴前端规约 - Git 规约》配套的 commitlint 可共享配置,用于对 git commit message 进行校验。

安装

除了本包,你需要同时安装 @commitlint/cli

npm install commitlint-config-ali @commitlint/cli --save-dev

使用

在你的 commitlint.config.js 中继承本包:

module.exports = {
  extends: ['ali'],
};

设置 git hook

可通过 husky 设置在 git commit 时触发 commitlint。

首先安装 husky:

npm install husky --save-dev

然后在 package.json 中增加:

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

更多信息可参考 commitlint 文档