forked from gipo999/smispi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.commitlintrc.js
56 lines (52 loc) · 1.12 KB
/
.commitlintrc.js
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
const fs = require("node:fs");
const path = require("node:path");
const { execSync } = require("child_process");
const apps = fs.readdirSync(path.resolve(__dirname, "src"));
const issue = execSync("git rev-parse --abbrev-ref HEAD")
.toString()
.trim()
.match(/\d+/)?.[0];
const definedScopes = [
"global",
...apps.map((app) => `app-${app}`),
"gradle",
"npm",
"git-hooks",
"actions",
"github",
"db",
"docs",
];
// .commitlintrc.js
/** @type {import('cz-git').UserConfig} */
module.exports = {
extends: ["@commitlint/config-conventional"],
rules: {
"scope-enum": [2, "always", [...definedScopes]],
},
prompt: {
useEmoji: true,
customIssuePrefixAlign: !issue ? "top" : "bottom",
defaultIssues: !issue ? "" : `#${issue}`,
issuePrefixes: [
{
name: "Close issue",
value: "closes",
},
{
name: "Fix issue",
value: "fixes",
},
{
name: "Link issue",
value: "links",
},
{
name: "Reference issue",
value: "refs",
},
],
enableMultipleScopes: true,
scopeEnumSeparator: "/",
},
};