mirror of
https://gitee.com/ShopeX/ECShopX_mobile-frontend
synced 2026-08-08 21:25:31 +08:00
[TBID:ECX-9138] feat(commitlint): add TBID header rule and update config for commit message validation
This commit is contained in:
14
commitlint-tbid-plugin.js
Normal file
14
commitlint-tbid-plugin.js
Normal file
@@ -0,0 +1,14 @@
|
||||
module.exports = {
|
||||
rules: {
|
||||
'tbid-header': (parsed, when = 'always') => {
|
||||
const matches =
|
||||
typeof parsed.header === 'string' && /^\[TBID:[A-Za-z0-9]+-\d+\]\s.+/.test(parsed.header)
|
||||
const negated = when === 'never'
|
||||
|
||||
return [
|
||||
negated ? !matches : matches,
|
||||
'commit message must start with [TBID:PROJECT-123] description'
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user