🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

commitlint-config-ykplus

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commitlint-config-ykplus

Commitlint shareable configuration for YkPlus F2E Guidelines

npmnpm
Version
1.0.3
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

commitlint-config-ykplus

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

安装

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

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

使用

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

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

配合 commitizen 和 husky 使用(推荐)

安装

npm install commitizen husky --save-dev

配置 commitizen

# npm 5.2+
npx commitizen init cz-conventional-changelog --save-dev --save-exact

这时候,你的 package.json 会出现下面配置:

...
  "config": {
    "commitizen": {
      "path": "cz-conventional-changelog"
    }
  }

设置 husky hooks

  • 添加 prepare-commit-msg hook
npx husky add .husky/prepare-commit-msg "exec < /dev/tty && npx cz --hook || true"
  • 添加 commit-msg hook
npx husky add .husky/commit-msg 'npx --no -- commitlint --edit "$1"'

更多信息可参考:

Keywords

commitlint

FAQs

Package last updated on 25 Jul 2023

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