-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommitlint.config.cjs
More file actions
68 lines (59 loc) · 2.06 KB
/
commitlint.config.cjs
File metadata and controls
68 lines (59 loc) · 2.06 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
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
/**
* Disable the line length limit for the commit header.
* This prevents validation errors when using descriptive subjects that
* exceed the default 100-character limit.
*/
'header-max-length': [0, 'always', Infinity],
/**
* Disable the line length limit for the commit body.
* This allows for detailed descriptions without triggering validation errors.
*/
'body-max-line-length': [0, 'always', Infinity],
/**
* Enforce the commit subject to start with a lower-case letter.
* By forbidding cases that start with a capital letter, we allow subjects
* to start with lowercase while preserved technical acronyms like API, URL, or ID.
* Example: feat(core): handle API response (Correct)
* Example: feat(core): fix URL redirect (Correct)
* Example: feat(core): Add API support (Incorrect - starts with capital)
*/
'subject-case': [2, 'never', ['sentence-case', 'start-case', 'pascal-case', 'upper-case']],
/**
* Prevent the commit subject from ending with a full stop (period).
* Example: feat(core): add something. (Incorrect)
*/
'subject-full-stop': [2, 'never', '.'],
/**
* Define the allowed scopes for this monorepo.
* The scope must be one of the directories or logical parts defined below.
*/
'scope-enum': [
2,
'always',
[
// Root
'core',
// Configuration Packages
'configs/eslint',
'configs/prettier',
// Product Packages
'packages/qwik',
'packages/utilities',
// Development & Demos
'playgrounds/qwik',
],
],
/**
* Require a scope to be present in every commit message.
* Prevents commits like: feat: add something
*/
'scope-empty': [2, 'never'],
/**
* Limit the allowed commit types to maintain a clean and predictable history.
*/
'type-enum': [2, 'always', ['feat', 'chore', 'refactor', 'fix', 'docs', 'test']],
},
};