Skip to content

Commit 15302ed

Browse files
committed
feat(types): ParserPreset
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
1 parent 2af7562 commit 15302ed

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* @file Type Tests - ParserPreset
3+
* @module commitlint-config/types/tests/unit-d/ParserPreset
4+
*/
5+
6+
import type { ParserOptions } from '#src/interfaces'
7+
import type TestSubject from '../parser-preset'
8+
9+
describe('unit-d:types/ParserPreset', () => {
10+
it('should match [name: "conventional-changelog-conventionalcommits"]', () => {
11+
expectTypeOf<TestSubject>()
12+
.toHaveProperty('name')
13+
.toEqualTypeOf<'conventional-changelog-conventionalcommits'>()
14+
})
15+
16+
it('should match [parserOpts: ParserOptions]', () => {
17+
expectTypeOf<TestSubject>()
18+
.toHaveProperty('parserOpts')
19+
.toEqualTypeOf<ParserOptions>()
20+
})
21+
})

src/types/index.ts

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

66
export type { default as NoteKeyword } from './note-keyword'
7+
export type { default as ParserPreset } from './parser-preset'
78
export type { default as Question } from './question'
89
export type { default as QuestionEnum } from './question-enum'
910
export type { default as Questions } from './questions'

src/types/parser-preset.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* @file Type Definitions - ParserPreset
3+
* @module commitlint-config/types/ParserPreset
4+
*/
5+
6+
import type { ParserOptions } from '#src/interfaces'
7+
8+
/**
9+
* Object representing a commit parser preset.
10+
*
11+
* @see https://commitlint.js.org/#/reference-configuration?id=parser-presets
12+
*/
13+
type ParserPreset = {
14+
/**
15+
* Preset name.
16+
*/
17+
name: 'conventional-changelog-conventionalcommits'
18+
19+
/**
20+
* Commit parser options.
21+
*
22+
* @see {@linkcode ParserOptions}
23+
*/
24+
parserOpts: ParserOptions
25+
}
26+
27+
export type { ParserPreset as default }

0 commit comments

Comments
 (0)