-
Notifications
You must be signed in to change notification settings - Fork 0
/
commitlint.mts
43 lines (38 loc) · 1.15 KB
/
commitlint.mts
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";
export const VALID_PREFIXES = ["Merge", "Revert"] as const;
export const Configuration: UserConfig = {
extends: ["@commitlint/config-conventional"],
rules: {
"type-enum": [
RuleConfigSeverity.Error,
"always",
[
"build",
"bump",
"chore",
"ci",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"style",
"test",
],
],
},
// The default ignores of commitlint allow prefixes like fixup! and squash!,
// which we don't allow. Therefore, we're turning off defaultIgnores and
// explicitly ignoring only auto-generated merge commit and revert messages
defaultIgnores: false,
ignores: [
(commit) => {
return VALID_PREFIXES.some((prefix) => {
return commit.startsWith(prefix);
});
},
],
};
export default Configuration;