-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
commitlint.config.js
59 lines (54 loc) · 1.78 KB
/
commitlint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { resolve } from '@stacksjs/path'
import { fs } from '@stacksjs/storage'
import { kebabCase } from '@stacksjs/strings'
import git from './config/git'
const ignore = ['readme-md']
const components = fs
.readdirSync(resolve(__dirname, './resources/components'))
.map((item) => kebabCase(item.replace(/\.(stx|vue)/g, '')))
.filter((item) => !ignore.includes(item))
const functions = fs
.readdirSync(resolve(__dirname, './resources/functions'))
.map((item) => kebabCase(item.replace(/.ts/g, '')))
.filter((item) => !ignore.includes(item))
const scopes = [...git.scopes, ...components, ...functions]
const uniqueScopes = [...new Set(scopes)]
/** @type {import('cz-git').UserConfig} */
export default {
rules: {
// @see: https://commitlint.js.org/#/reference-rules
'scope-enum': [2, 'always', uniqueScopes],
},
prompt: {
messages: git.messages,
types: git.types,
useEmoji: false,
themeColorCode: '',
scopes: uniqueScopes,
allowCustomScopes: true,
allowEmptyScopes: true,
customScopesAlign: 'bottom',
customScopesAlias: 'custom',
emptyScopesAlias: 'empty',
upperCaseSubject: false,
allowBreakingChanges: ['feat', 'fix'],
breaklineNumber: 100,
breaklineChar: '|',
skipQuestions: [],
issuePrefixes: [{ value: 'closed', name: 'closed: ISSUES has been processed' }],
customIssuePrefixesAlign: 'top',
emptyIssuePrefixesAlias: 'skip',
customIssuePrefixesAlias: 'custom',
allowCustomIssuePrefixes: true,
allowEmptyIssuePrefixes: true,
confirmColorize: true,
maxHeaderLength: Number.POSITIVE_INFINITY,
maxSubjectLength: Number.POSITIVE_INFINITY,
minSubjectLength: 0,
scopeOverrides: undefined,
defaultBody: '',
defaultIssues: '',
defaultScope: '',
defaultSubject: '',
},
}