/** @type {import('@commitlint/types').UserConfig} */ module.exports = { extends: ['@commitlint/config-conventional'], plugins: [ { rules: { 'scope-no-commas': ({ scope }) => { if (scope && scope.includes(',')) { return [ false, 'scope must not contain commas (semantic-release will not parse the commit type)', ]; } return [true]; }, /** Subject after «:» must contain Cyrillic (project convention). */ 'subject-cyrillic': ({ subject }) => { if (!subject) return [true]; if (/[а-яёА-ЯЁ]/.test(subject)) return [true]; return [ false, 'subject after «:» must be in Russian (Cyrillic), e.g. feat(web): добавить экран нод', ]; }, }, }, ], rules: { // Subject после «:» на русском — не английский sentence-case. 'subject-case': [0], 'scope-no-commas': [2, 'always'], 'subject-cyrillic': [2, 'always'], 'type-enum': [ 2, 'always', [ 'feat', 'fix', 'perf', 'ci', 'refactor', 'docs', 'chore', 'test', 'style', 'build', 'revert', ], ], }, };