Files
ECShopX_mobile-frontend/commitlint-tbid-plugin.js

15 lines
385 B
JavaScript

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'
]
}
}
}