Skip to content

Commit e07cd2f

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

File tree

5 files changed

+42
-1
lines changed

5 files changed

+42
-1
lines changed

Diff for: src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
*/
55

66
export * from './enums'
7+
export * from './types'

Diff for: src/types/__tests__/note-keyword.spec-d.ts

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* @file Type Tests - NoteKeyword
3+
* @module commitlint-config/types/tests/unit-d/NoteKeyword
4+
*/
5+
6+
import type TestSubject from '../note-keyword'
7+
8+
describe('unit-d:types/NoteKeyword', () => {
9+
it('should extract "BREAKING CHANGE"', () => {
10+
expectTypeOf<TestSubject>().extract('BREAKING CHANGE').toBeString()
11+
})
12+
13+
it('should extract "BREAKING-CHANGE"', () => {
14+
expectTypeOf<TestSubject>().extract('BREAKING-CHANGE').toBeString()
15+
})
16+
})

Diff for: src/types/index.ts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* @file Entry Point - Type Definitions
3+
* @module commitlint-config/types
4+
*/
5+
6+
export type { default as NoteKeyword } from './note-keyword'

Diff for: src/types/note-keyword.ts

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* @file Type Definitions - NoteKeyword
3+
* @module commitlint-config/types/NoteKeyword
4+
*/
5+
6+
/**
7+
* Keywords for important notes.
8+
*
9+
* @see https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-commits-parser/README.md#notekeywords
10+
*/
11+
type NoteKeyword = 'BREAKING CHANGE' | 'BREAKING-CHANGE'
12+
13+
export type { NoteKeyword as default }

Diff for: vitest.config.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ const config: UserConfigExport = defineConfig((): UserConfig => {
5252
all: !LINT_STAGED,
5353
clean: true,
5454
cleanOnRerun: true,
55-
exclude: ['**/__mocks__/**', '**/__tests__/**', '**/index.ts'],
55+
exclude: [
56+
'**/__mocks__/**',
57+
'**/__tests__/**',
58+
'**/index.ts',
59+
'src/types/'
60+
],
5661
extension: ['.ts'],
5762
ignoreClassMethods: [],
5863
include: ['src'],

0 commit comments

Comments
 (0)