-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommitlint.config.cjs
More file actions
47 lines (47 loc) · 1.18 KB
/
commitlint.config.cjs
File metadata and controls
47 lines (47 loc) · 1.18 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
/** @type {import('@commitlint/types').UserConfig} */
module.exports = {
extends: ["@commitlint/config-conventional"],
plugins: [
{
rules: {
"no-ai-attribution": ({ raw }) => {
const text = String(raw || "")
const has = /co-authored-by:|generated by (claude|chatgpt|copilot|ai)|🤖/i.test(text)
return [
!has,
"commit must not attribute work to AI (no Co-authored-by, no AI references)",
]
},
"no-pm-id-in-subject": ({ subject }) => {
const s = String(subject || "")
const has = /\b[A-Z]{2,}-\d+\b/.test(s)
return [!has, "commit subject must not contain PM-style IDs (e.g. WORK-11)"]
},
},
},
],
rules: {
"type-enum": [
2,
"always",
[
"feat",
"fix",
"refactor",
"docs",
"chore",
"test",
"perf",
"style",
"build",
"ci",
"revert",
],
],
"subject-case": [2, "always", "lower-case"],
"body-leading-blank": [0],
"footer-leading-blank": [0],
"no-ai-attribution": [2, "always"],
"no-pm-id-in-subject": [2, "always"],
},
}