-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommitlint.config.js
More file actions
132 lines (128 loc) · 3.41 KB
/
commitlint.config.js
File metadata and controls
132 lines (128 loc) · 3.41 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/** @type {import('@commitlint/types').UserConfig} */
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
// Types allowed in this project
'type-enum': [
2,
'always',
[
'feat', // New feature
'fix', // Bug fix
'perf', // Performance improvement
'refactor', // Code change, no feature/fix
'security', // Security fix
'test', // Tests only
'docs', // Documentation
'chore', // Tooling, deps, CI
'ci', // CI/CD changes
'build', // Build system
'revert', // Revert a commit
'style', // Formatting, whitespace
'wip', // Work in progress (blocked from main via branch protection)
],
],
// Scopes map to monorepo packages / areas
'scope-enum': [
1,
'always',
[
// Apps
'client',
'admin',
'scanner',
'marketing',
// Packages
'ui',
'db',
'seeding',
'types',
'config',
// Cross-cutting
'auth',
'api',
'qr',
'scan',
'team',
'projects',
'crm',
'residents',
'units',
'contacts',
'gates',
'settings',
'ai',
'i18n',
'rtl',
'analytics',
// Infra
'ci',
'deploy',
'scripts',
'deps',
'docs',
'release',
],
],
'scope-case': [1, 'always', 'kebab-case'],
'subject-case': [2, 'never', ['start-case', 'pascal-case', 'upper-case']],
'subject-empty': [2, 'never'],
'subject-full-stop': [2, 'never', '.'],
'subject-max-length': [2, 'always', 100],
'body-max-line-length': [1, 'always', 200],
'header-max-length': [2, 'always', 120],
},
// Helpful prompt when running `git commit` interactively
prompt: {
messages: {
type: 'Select the type of change:',
scope: 'What is the scope? (optional, press enter to skip):',
subject: 'Write a short description (max 100 chars):',
body: 'Provide a longer description (optional, press enter to skip):',
},
questions: {
type: {
description: "Select the type of change that you're committing",
enum: {
feat: {
description: 'A new feature',
title: 'Features',
emoji: '✨',
},
fix: { description: 'A bug fix', title: 'Bug Fixes', emoji: '🐛' },
perf: {
description: 'Performance improvement',
title: 'Performance',
emoji: '⚡',
},
security: {
description: 'Security fix',
title: 'Security',
emoji: '🔒',
},
refactor: {
description: 'Code refactor without feature/fix',
title: 'Refactoring',
emoji: '♻️',
},
docs: {
description: 'Documentation only',
title: 'Documentation',
emoji: '📝',
},
chore: {
description: 'Tooling, deps, CI — no production code',
title: 'Chores',
emoji: '🔧',
},
test: {
description: 'Test additions or corrections',
title: 'Tests',
emoji: '🧪',
},
ci: { description: 'CI/CD configuration', title: 'CI', emoji: '👷' },
},
},
},
},
};