Skip to content

Commit dbb1e78

Browse files
committed
feat(enums): Type
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
1 parent 12b1d61 commit dbb1e78

File tree

3 files changed

+109
-0
lines changed

3 files changed

+109
-0
lines changed

src/enums/__tests__/type.spec-d.ts

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/**
2+
* @file Type Tests - Type
3+
* @module commitlint-config/enums/tests/unit-d/Type
4+
*/
5+
6+
import type TestSubject from '../type'
7+
8+
describe('unit-d:enums/Type', () => {
9+
it('should match [BUILD = "build"]', () => {
10+
expectTypeOf<typeof TestSubject>()
11+
.toHaveProperty('BUILD')
12+
.toMatchTypeOf<'build'>()
13+
})
14+
15+
it('should match [CHORE = "chore"]', () => {
16+
expectTypeOf<typeof TestSubject>()
17+
.toHaveProperty('CHORE')
18+
.toMatchTypeOf<'chore'>()
19+
})
20+
21+
it('should match [CI = "ci"]', () => {
22+
expectTypeOf<typeof TestSubject>()
23+
.toHaveProperty('CI')
24+
.toMatchTypeOf<'ci'>()
25+
})
26+
27+
it('should match [DOCS = "docs"]', () => {
28+
expectTypeOf<typeof TestSubject>()
29+
.toHaveProperty('DOCS')
30+
.toMatchTypeOf<'docs'>()
31+
})
32+
33+
it('should match [FEAT = "feat"]', () => {
34+
expectTypeOf<typeof TestSubject>()
35+
.toHaveProperty('FEAT')
36+
.toMatchTypeOf<'feat'>()
37+
})
38+
39+
it('should match [FIX = "fix"]', () => {
40+
expectTypeOf<typeof TestSubject>()
41+
.toHaveProperty('FIX')
42+
.toMatchTypeOf<'fix'>()
43+
})
44+
45+
it('should match [PERF = "perf"]', () => {
46+
expectTypeOf<typeof TestSubject>()
47+
.toHaveProperty('PERF')
48+
.toMatchTypeOf<'perf'>()
49+
})
50+
51+
it('should match [REFACTOR = "refactor"]', () => {
52+
expectTypeOf<typeof TestSubject>()
53+
.toHaveProperty('REFACTOR')
54+
.toMatchTypeOf<'refactor'>()
55+
})
56+
57+
it('should match [REVERT = "revert"]', () => {
58+
expectTypeOf<typeof TestSubject>()
59+
.toHaveProperty('REVERT')
60+
.toMatchTypeOf<'revert'>()
61+
})
62+
63+
it('should match [STYLE = "style"]', () => {
64+
expectTypeOf<typeof TestSubject>()
65+
.toHaveProperty('STYLE')
66+
.toMatchTypeOf<'style'>()
67+
})
68+
69+
it('should match [TEST = "test"]', () => {
70+
expectTypeOf<typeof TestSubject>()
71+
.toHaveProperty('TEST')
72+
.toMatchTypeOf<'test'>()
73+
})
74+
75+
it('should match [WIP = "wip"]', () => {
76+
expectTypeOf<typeof TestSubject>()
77+
.toHaveProperty('WIP')
78+
.toMatchTypeOf<'wip'>()
79+
})
80+
})

src/enums/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
export { default as PromptKind } from './kind-prompt'
77
export { default as ReferenceAction } from './reference-action'
88
export { default as Scope } from './scope'
9+
export { default as Type } from './type'

src/enums/type.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* @file Enums - Type
3+
* @module commitlint-config/enums/Type
4+
*/
5+
6+
/**
7+
* Commit types.
8+
*
9+
* @see https://commitlint.js.org/#/reference-rules?id=type-enum
10+
*
11+
* @enum {Lowercase<string>}
12+
*/
13+
enum Type {
14+
BUILD = 'build',
15+
CHORE = 'chore',
16+
CI = 'ci',
17+
DOCS = 'docs',
18+
FEAT = 'feat',
19+
FIX = 'fix',
20+
PERF = 'perf',
21+
REFACTOR = 'refactor',
22+
REVERT = 'revert',
23+
STYLE = 'style',
24+
TEST = 'test',
25+
WIP = 'wip'
26+
}
27+
28+
export default Type

0 commit comments

Comments
 (0)