forked from UfoMiao/zcf
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommitlint.config.ts
More file actions
43 lines (36 loc) · 1.63 KB
/
commitlint.config.ts
File metadata and controls
43 lines (36 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import type { UserConfig } from '@commitlint/types'
import { RuleConfigSeverity } from '@commitlint/types'
/**
* Commitlint configuration for ZCF project
* Extends standard Conventional Commits specification with project-specific rules
*
* Features:
* - Standard Conventional Commits types (feat, fix, docs, etc.)
* - Optional scope (scope is not required but allowed)
* - Subject validation (no trailing period, flexible case)
* - Header length limit (100 characters)
* - TypeScript type safety with @commitlint/types
*/
const config: UserConfig = {
extends: ['@commitlint/config-conventional'],
rules: {
// Scope configuration - make scope optional per requirement
'scope-empty': [RuleConfigSeverity.Disabled], // Allow empty scopes
'scope-case': [RuleConfigSeverity.Disabled], // Don't enforce scope case when present
// Subject validation rules
'subject-empty': [RuleConfigSeverity.Error, 'never'],
'subject-full-stop': [RuleConfigSeverity.Error, 'never', '.'],
'subject-case': [RuleConfigSeverity.Disabled], // Allow flexible subject case
// Header length constraints
'header-max-length': [RuleConfigSeverity.Error, 'always', 100],
// Type validation
'type-empty': [RuleConfigSeverity.Error, 'never'],
'type-case': [RuleConfigSeverity.Error, 'always', 'lower-case'],
// Body configuration (optional)
'body-leading-blank': [RuleConfigSeverity.Warning, 'always'],
'body-max-line-length': [RuleConfigSeverity.Disabled], // Allow flexible body length
// Footer configuration (optional)
'footer-leading-blank': [RuleConfigSeverity.Warning, 'always'],
},
}
export default config