-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommitlint.config.ts
30 lines (26 loc) · 953 Bytes
/
commitlint.config.ts
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
// ref: https://commitlint.js.org/reference/configuration.html
import conventionalConfig from "@commitlint/config-conventional";
import type { UserConfig } from "@commitlint/types";
const excludeQuestions: string[] = [
// exclude isBreaking, breaking, and breakingBody because this package does not have versioning
"isBreaking",
"breaking",
"breakingBody",
// exclude isIssueAffected, issuesBody, and issues because I link branches to issues using GitHub
"isIssueAffected",
"issuesBody",
"issues",
] satisfies (keyof typeof conventionalConfig.prompt.questions)[];
const commitlintConfig: UserConfig = {
// do not use extends because we cannot exclude properties from the parent
...conventionalConfig,
prompt: {
...conventionalConfig.prompt,
questions: Object.fromEntries(
Object.entries(conventionalConfig.prompt.questions).filter(
([key]) => !excludeQuestions.includes(key),
),
),
},
};
export default commitlintConfig;