-
-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathcommitlint.config.js
More file actions
34 lines (34 loc) · 974 Bytes
/
commitlint.config.js
File metadata and controls
34 lines (34 loc) · 974 Bytes
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
export default {
extends: ["@commitlint/config-conventional"],
plugins: [
{
rules: {
"breaking-exclamation-required": (parsed) => {
const footerText = `${parsed.footer || ""}\n${parsed.body || ""}`;
const hasBreakingFooter = /BREAKING CHANGE:|BREAKING-CHANGE:/i.test(
footerText
);
const hasHeaderBang = /!:/i.test(parsed.header || "");
if (hasBreakingFooter && !hasHeaderBang) {
return [
false,
"Breaking changes must include ! in the header (feat!: or feat(scope)!).",
];
}
return [true];
},
},
},
],
rules: {
"type-enum": [
2,
"always",
["fix", "feat", "refactor", "chore", "docs", "ci"],
],
"scope-case": [2, "always", "kebab-case"],
"subject-empty": [2, "never"],
"breaking-exclamation-required": [2, "always"],
"body-max-line-length": [0],
},
};