File tree Expand file tree Collapse file tree 4 files changed +62
-1
lines changed Expand file tree Collapse file tree 4 files changed +62
-1
lines changed Original file line number Diff line number Diff line change 7474 "dependencies" : {
7575 "@commitlint/config-conventional" : " 17.4.4" ,
7676 "@commitlint/types" : " 17.4.4" ,
77+ "@flex-development/tutils" : " 6.0.0-alpha.10" ,
7778 "conventional-changelog-conventionalcommits" : " 5.0.0"
7879 },
7980 "devDependencies" : {
8283 "@flex-development/mkbuild" : " 1.0.0-alpha.14" ,
8384 "@flex-development/mlly" : " 1.0.0-alpha.13" ,
8485 "@flex-development/pathe" : " 1.0.3" ,
85- "@flex-development/tutils" : " 6.0.0-alpha.10" ,
8686 "@graphql-eslint/eslint-plugin" : " 3.16.0" ,
8787 "@types/chai" : " 4.3.4" ,
8888 "@types/conventional-changelog" : " 3.1.1" ,
Original file line number Diff line number Diff line change 1+ /**
2+ * @file Type Tests - Questions
3+ * @module commitlint-config/types/tests/unit-d/Questions
4+ */
5+
6+ import { PromptKind , Scope , Type } from '#src/enums'
7+ import type Question from '../question'
8+ import type QuestionEnum from '../question-enum'
9+ import type TestSubject from '../questions'
10+
11+ describe ( 'unit-d:types/Questions' , ( ) => {
12+ it ( 'should extend Record<PromptKind, Question>' , ( ) => {
13+ expectTypeOf < TestSubject > ( ) . toMatchTypeOf < Record < PromptKind , Question > > ( )
14+ } )
15+
16+ it ( 'should match [PromptKind.SCOPE: Question<Scope>]' , ( ) => {
17+ expectTypeOf < TestSubject > ( )
18+ . toHaveProperty ( PromptKind . SCOPE )
19+ . toEqualTypeOf < Question < Scope > > ( )
20+ } )
21+
22+ it ( 'should match [PromptKind.TYPE: Question<Type, Required<QuestionEnum>>]' , ( ) => {
23+ expectTypeOf < TestSubject > ( )
24+ . toHaveProperty ( PromptKind . TYPE )
25+ . toEqualTypeOf < Question < Type , Required < QuestionEnum > > > ( )
26+ } )
27+ } )
Original file line number Diff line number Diff line change 66export type { default as NoteKeyword } from './note-keyword'
77export type { default as Question } from './question'
88export type { default as QuestionEnum } from './question-enum'
9+ export type { default as Questions } from './questions'
Original file line number Diff line number Diff line change 1+ /**
2+ * @file Type Definitions - Questions
3+ * @module commitlint-config/types/Questions
4+ */
5+
6+ import type { PromptKind , Scope , Type } from '#src/enums'
7+ import type { Overwrite } from '@flex-development/tutils'
8+ import type Question from './question'
9+ import type QuestionEnum from './question-enum'
10+
11+ /**
12+ * Prompt questions.
13+ *
14+ * @see https://commitlint.js.org/#/reference-prompt?id=questions
15+ *
16+ * @extends {Record<PromptKind,Question> }
17+ */
18+ type Questions = Overwrite <
19+ Record < PromptKind , Question > ,
20+ {
21+ /**
22+ * Commit scope questions configuration.
23+ */
24+ [ PromptKind . SCOPE ] : Question < Scope >
25+
26+ /**
27+ * Commit type questions configuration.
28+ */
29+ [ PromptKind . TYPE ] : Question < Type , Required < QuestionEnum > >
30+ }
31+ >
32+
33+ export type { Questions as default }
You can’t perform that action at this time.
0 commit comments