-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.commitlintrc.mjs
59 lines (52 loc) · 2.05 KB
/
.commitlintrc.mjs
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
// Maintain a consistent coding style throughout the entire project codebase to
// ensure readability and maintainability. Consistent style not only improves
// collaboration but also makes the code easier to review and debug.
// Linter configuration for rules on commit messages that are checked on pull
// requests, and before push to origin from local reposiotry. For more
// information about, refer to the commitlint official documentation for the
// reference rules, see here: https://commitlint.js.org/#/reference-rules
// The rules are still a work in progress and subject to change. I still need
// to think about this configuration, and for now this is a base template.
// These rules are used to check if the commit message contains a type. The
// type is the first word in the commit message and must match one of the types
// defined in the `typesRule` array in this configuration file.
/** The array of type rules that are allowed in commit messages. */
const typesRule = [
"build",
"chore",
"ci",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"style",
"test",
];
/** The array of subject rules that are allowed in commit messages. */
const subjectsRule = [
"upper-case",
"pascal-case",
"sentence-case",
"start-case",
];
/** The rules for commitlint that is used in GitHub Workflow Actions on PR. */
const commitlintConfig = {
rules: {
"type-enum": [2, "always", typesRule],
"type-case": [2, "always", "lower-case"],
"type-empty": [2, "never"],
"scope-case": [2, "always", "kebab-case"],
"subject-case": [2, "always", "sentence-case"],
"subject-empty": [2, "never"],
"subject-full-stop": [2, "never", "."],
"header-max-length": [2, "always", 72],
"body-case": [2, "always", "sentence-case"],
"body-leading-blank": [2, "always"],
"body-max-line-length": [1, "always", 80],
"footer-leading-blank": [2, "always"],
"footer-max-line-length": [1, "always", 80],
},
};
export default commitlintConfig;