Zhengqbbb / cz-git

cz-git | czg 🛠️ DX first and more engineered, lightweight, customizable, standard output format Commitizen adapter and CLI
https://cz-git.qbb.sh
MIT License
1.11k stars 41 forks source link

[Bug report] 使用Emoje配置模板,commitlint 无法找到 commitlint.config.js 报错 #129

Closed arronf2e closed 1 year ago

arronf2e commented 1 year ago

✅ Checklist

📄 System Info

System:
    OS: macOS 12.5.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 1.06 GB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.18.1 - ~/.nvm/versions/node/v16.18.1/bin/node
    Yarn: 1.22.19 - ~/.npm-global/bin/yarn
    npm: 8.19.2 - ~/.nvm/versions/node/v16.18.1/bin/npm
  npmPackages:
    commitizen: ^4.3.0 => 4.3.0 
    cz-git: ^1.6.1 => 1.6.1 
  npmGlobalPackages:
    commitizen: 4.3.0

🔎 Description

Concise Description

Expected behavior

Steps to reproduce

Screenshots or Screen Recording(if possible)

image

🔗 Reproduction link / repo:

No response

Zhengqbbb commented 1 year ago

commitlint 验证命令失败与 cz-git 没有关系

使用 commitlint 的配置并使用的 commitlint CLI 进行验证是要添加至少一个规则的 例如:

rules: {
    'subject-empty': [2, 'never'],
  },

如果不想添加 commitlint 规则或使用 commitlint 配置文件

可以使用 cz.config.jscz.config.cjs 或在package.json 中指定 js 文件

"config": {
    "commitizen": {
      "path": "node_modules/cz-git",
      "czConfig": "./config/cz.config.js"
    }
  }

希望有所帮助