0

我刚刚将 Angular 11 应用程序更新为 eslint 并安装了 commitizen、commitlint、husky 和语义发布,以通过 npm 和 Travis 驱动 CI。

我按照 Angular 推荐链接上的说明进行操作。

Linting 本身工作正常。

该问题出现在 commit-msg 挂钩中,但较早引起。

现在,当我运行时,npx git-cz我得到了一组不同的“提交类型”类型。

我得到修复、更新、破坏、文档、构建、新建、升级。

以前我得到了 Angular 标准列表“feat、fix、docs、style、refactor、perf、test、ci、chore、revert”。

commit-msg 挂钩失败的原因有两个:

  1. type must be lower-case
  2. type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test]

我花了几个小时阅读所有相关文档,但找不到如何将类型列表更改回原来的样子。

任何建议都会非常受欢迎。

4

1 回答 1

1

这个问题只在我安装的时候出现cz-adapter-eslint

该适配器本身基于conventional-changelog-eslinthttps://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-eslint

正是这个变更日志文件介绍了从 Angular 提交消息到 ESLint 约定提交消息格式的变化。

简单的解决方法是删除cz-adapter-eslint.

当我有时间找出推荐的适配器时,我将不得不进一步研究。

于 2021-01-14T06:22:31.897 回答