Skip to content

Commit c55d596

Browse files
committed
feat(types): QuestionEnum
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
1 parent e07cd2f commit c55d596

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* @file Type Tests - QuestionEnum
3+
* @module commitlint-config/types/tests/unit-d/QuestionEnum
4+
*/
5+
6+
import type TestSubject from '../question-enum'
7+
8+
describe('unit-d:types/QuestionEnum', () => {
9+
it('should match [description?: string]', () => {
10+
expectTypeOf<TestSubject>()
11+
.toHaveProperty('description')
12+
.toEqualTypeOf<string | undefined>()
13+
})
14+
15+
it('should match [emoji?: string]', () => {
16+
expectTypeOf<TestSubject>()
17+
.toHaveProperty('emoji')
18+
.toEqualTypeOf<string | undefined>()
19+
})
20+
21+
it('should match [title?: string]', () => {
22+
expectTypeOf<TestSubject>()
23+
.toHaveProperty('title')
24+
.toEqualTypeOf<string | undefined>()
25+
})
26+
})

src/types/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
*/
55

66
export type { default as NoteKeyword } from './note-keyword'
7+
export type { default as QuestionEnum } from './question-enum'

src/types/question-enum.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* @file Type Definitions - QuestionEnum
3+
* @module commitlint-config/types/QuestionEnum
4+
*/
5+
6+
/**
7+
* Object representing prompt question metadata.
8+
*
9+
* @see https://commitlint.js.org/#/reference-prompt?id=questions
10+
*/
11+
type QuestionEnum = {
12+
/**
13+
* Enum description.
14+
*/
15+
description?: string
16+
17+
/**
18+
* Emoji to display next to {@linkcode title}.
19+
*/
20+
emoji?: string
21+
22+
/**
23+
* Prompt title.
24+
*/
25+
title?: string
26+
}
27+
28+
export type { QuestionEnum as default }

0 commit comments

Comments
 (0)