【发布时间】:2021-08-30 23:54:11
【问题描述】:
在我的 Angular 项目中,我想用一些预定义的 scopes 扩展 @commitlint/config-conventional。
Angular 项目有一个用于 UI 组件的库(通过 ng generate library 生成)和一个使用 UI 库的默认应用。
在commitlint.config.js 我添加了以下几行:
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'scope-enum': [
2,
'always',
[
'ui-components',
'ui-components/badge',
'ui-components/button',
'ui-components/tooltip',
'core',
'account',
'plugins',
'settings',
'projects',
'shared',
'styles'
]
]
}
};
但是,当我尝试在范围内提交某些内容时:'ui-components/tooltip':
fix(ui-components/tooltip): fix border
我收到一个 commitlint 错误,说:
⧗ input: fix(ui-components/tooltip): fix border
✖ scope must be one of [ui-components, ui-components/badge, ui/button, ui-components/tooltip, core, account, plugins, settings, projects, shared, styles] [scope-enum]
✖ found 1 problems, 0 warnings
【问题讨论】:
标签: conventional-commits conventional-changelog