Skip to content

Commit 63b78a2

Browse files
committed
feat(enums): PromptKind
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
1 parent 6c86561 commit 63b78a2

File tree

4 files changed

+103
-1
lines changed

4 files changed

+103
-1
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/**
2+
* @file Type Tests - PromptKind
3+
* @module commitlint-config/enums/tests/unit-d/PromptKind
4+
*/
5+
6+
import type TestSubject from '../kind-prompt'
7+
8+
describe('unit-d:enums/PromptKind', () => {
9+
it('should match [BODY = "body"]', () => {
10+
expectTypeOf<typeof TestSubject>()
11+
.toHaveProperty('BODY')
12+
.toMatchTypeOf<'body'>()
13+
})
14+
15+
it('should match [BREAKING = "breaking"]', () => {
16+
expectTypeOf<typeof TestSubject>()
17+
.toHaveProperty('BREAKING')
18+
.toMatchTypeOf<'breaking'>()
19+
})
20+
21+
it('should match [BREAKING_BODY = "breakingBody"]', () => {
22+
expectTypeOf<typeof TestSubject>()
23+
.toHaveProperty('BREAKING_BODY')
24+
.toMatchTypeOf<'breakingBody'>()
25+
})
26+
27+
it('should match [ISSUES = "issues"]', () => {
28+
expectTypeOf<typeof TestSubject>()
29+
.toHaveProperty('ISSUES')
30+
.toMatchTypeOf<'issues'>()
31+
})
32+
33+
it('should match [ISSUES_BODY = "issuesBody"]', () => {
34+
expectTypeOf<typeof TestSubject>()
35+
.toHaveProperty('ISSUES_BODY')
36+
.toMatchTypeOf<'issuesBody'>()
37+
})
38+
39+
it('should match [IS_BREAKING = "isBreaking"]', () => {
40+
expectTypeOf<typeof TestSubject>()
41+
.toHaveProperty('IS_BREAKING')
42+
.toMatchTypeOf<'isBreaking'>()
43+
})
44+
45+
it('should match [IS_ISSUE_AFFECTED = "isIssueAffected"]', () => {
46+
expectTypeOf<typeof TestSubject>()
47+
.toHaveProperty('IS_ISSUE_AFFECTED')
48+
.toMatchTypeOf<'isIssueAffected'>()
49+
})
50+
51+
it('should match [SCOPE = "scope"]', () => {
52+
expectTypeOf<typeof TestSubject>()
53+
.toHaveProperty('SCOPE')
54+
.toMatchTypeOf<'scope'>()
55+
})
56+
57+
it('should match [SUBJECT = "subject"]', () => {
58+
expectTypeOf<typeof TestSubject>()
59+
.toHaveProperty('SUBJECT')
60+
.toMatchTypeOf<'subject'>()
61+
})
62+
63+
it('should match [TYPE = "type"]', () => {
64+
expectTypeOf<typeof TestSubject>()
65+
.toHaveProperty('TYPE')
66+
.toMatchTypeOf<'type'>()
67+
})
68+
})

src/enums/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* @file Entry Point - Enums
3+
* @module commitlint-config/enums
4+
*/
5+
6+
export { default as PromptKind } from './kind-prompt'

src/enums/kind-prompt.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* @file Enums - PromptKind
3+
* @module commitlint-config/enums/PromptKind
4+
*/
5+
6+
import type { PromptName } from '@commitlint/types'
7+
8+
/**
9+
* Prompt names.
10+
*
11+
* @see https://commitlint.js.org/#/reference-prompt
12+
*
13+
* @enum {PromptName}
14+
*/
15+
enum PromptKind {
16+
BODY = 'body',
17+
BREAKING = 'breaking',
18+
BREAKING_BODY = 'breakingBody',
19+
ISSUES = 'issues',
20+
ISSUES_BODY = 'issuesBody',
21+
IS_BREAKING = 'isBreaking',
22+
IS_ISSUE_AFFECTED = 'isIssueAffected',
23+
SCOPE = 'scope',
24+
SUBJECT = 'subject',
25+
TYPE = 'type'
26+
}
27+
28+
export default PromptKind

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
* @module commitlint-config
44
*/
55

6-
export {}
6+
export * from './enums'

0 commit comments

Comments
 (0)