Skip to content

Commit 9bd1060

Browse files
committed
feat(config): prompt
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
1 parent f89bd8f commit 9bd1060

File tree

2 files changed

+129
-0
lines changed

2 files changed

+129
-0
lines changed

Diff for: src/config/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ export { default as formatter } from './formatter'
88
export { default as helpUrl } from './help-url'
99
export { default as ignores } from './ignores'
1010
export { default as plugins } from './plugins'
11+
export { default as prompt } from './prompt'

Diff for: src/config/prompt.ts

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
/**
2+
* @file Config - prompt
3+
* @module commitlint-config/config/prompt
4+
*/
5+
6+
import { PromptKind, Type } from '#src/enums'
7+
import type { PromptConfig } from '#src/interfaces'
8+
9+
/**
10+
* Prompt configuration used by [`@commitlint/cz-commitlint`][1].
11+
*
12+
* [1]: https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/cz-commitlint
13+
*
14+
* @see {@linkcode PromptConfig}
15+
* @see https://commitlint.js.org/#/reference-prompt
16+
*
17+
* @const {PromptConfig} prompt
18+
*/
19+
const prompt: PromptConfig = {
20+
messages: {
21+
emptyWarning: 'can not be empty',
22+
lowerLimitWarning: 'below limit',
23+
max: 'upper %d chars',
24+
min: '%d chars at least',
25+
skip: ':skip',
26+
upperLimitWarning: 'over limit'
27+
},
28+
questions: {
29+
[PromptKind.BODY]: {
30+
description: 'Longer description of change(s)'
31+
},
32+
[PromptKind.BREAKING]: {
33+
description: 'Describe the breaking change(s)'
34+
},
35+
[PromptKind.BREAKING_BODY]: {
36+
description: 'A BREAKING CHANGE commit requires a body'
37+
},
38+
[PromptKind.IS_BREAKING]: {
39+
description: 'Are there any breaking changes?'
40+
},
41+
[PromptKind.IS_ISSUE_AFFECTED]: {
42+
description: 'Does this change affect any open issues?'
43+
},
44+
[PromptKind.ISSUES]: {
45+
description: 'Add issue references (e.g. "fixes #123")'
46+
},
47+
[PromptKind.ISSUES_BODY]: {
48+
description: 'If issues are closed, the commit requires a body'
49+
},
50+
[PromptKind.SCOPE]: {
51+
description: 'What is the scope of this change?'
52+
},
53+
[PromptKind.SUBJECT]: {
54+
description: 'Short, imperative tense description of the change'
55+
},
56+
[PromptKind.TYPE]: {
57+
description: 'Type of change being committed',
58+
enum: {
59+
[Type.BUILD]: {
60+
description: '',
61+
emoji: '📦',
62+
title: 'Build'
63+
},
64+
[Type.CHORE]: {
65+
description: '',
66+
emoji: '🏡',
67+
title: 'Housekeeping'
68+
},
69+
[Type.CI]: {
70+
description: '',
71+
emoji: '🤖',
72+
title: 'Continuous Integration'
73+
},
74+
[Type.DOCS]: {
75+
description: '',
76+
emoji: '📝',
77+
title: 'Documentation'
78+
},
79+
[Type.FEAT]: {
80+
description: '',
81+
emoji: '✨',
82+
title: 'Features'
83+
},
84+
[Type.FIX]: {
85+
description: '',
86+
emoji: '🐛',
87+
title: 'Fixes'
88+
},
89+
[Type.PERF]: {
90+
description: '',
91+
emoji: '🔥',
92+
title: 'Performance Improvements'
93+
},
94+
[Type.REFACTOR]: {
95+
description: '',
96+
emoji: '🦾',
97+
title: 'Refactors'
98+
},
99+
[Type.REVERT]: {
100+
description: '',
101+
emoji: '🗑️',
102+
title: 'Reverts'
103+
},
104+
[Type.STYLE]: {
105+
description: '',
106+
emoji: '🥸',
107+
title: 'Style'
108+
},
109+
[Type.TEST]: {
110+
description: '',
111+
emoji: '✅',
112+
title: 'Testing'
113+
},
114+
[Type.WIP]: {
115+
description: '',
116+
emoji: '🚧',
117+
title: 'Work in Progress'
118+
}
119+
}
120+
}
121+
},
122+
settings: {
123+
enableMultipleScopes: true,
124+
scopeEnumSeparator: ','
125+
}
126+
}
127+
128+
export default prompt

0 commit comments

Comments
 (0)