-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommitlint.config.ts
More file actions
42 lines (39 loc) · 1.08 KB
/
Copy pathcommitlint.config.ts
File metadata and controls
42 lines (39 loc) · 1.08 KB
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
import configPnpmScopes from "@commitlint/config-pnpm-scopes";
import { RuleConfigSeverity, type UserConfig } from "@commitlint/types";
const SCOPE_ALIASES: Record<string, string> = {
"open-cloud": "ocale",
"typescript-config": "tsconfig",
"vite-config": "vite",
};
const EXTRA_SCOPES = ["deps"];
export default {
extends: ["@commitlint/config-conventional", "@commitlint/config-pnpm-scopes"],
rules: {
"header-max-length": [RuleConfigSeverity.Error, "always", 72],
"scope-enum": async (ctx) => {
const [level, applicable, scopes] = (await configPnpmScopes.rules["scope-enum"](
ctx,
)) as [RuleConfigSeverity, "always", Array<string>];
const aliased = scopes.map((scope) => SCOPE_ALIASES[scope] ?? scope);
return [level, applicable, [...aliased, ...EXTRA_SCOPES]];
},
"subject-case": [RuleConfigSeverity.Error, "always", ["lower-case"]],
"type-enum": [
RuleConfigSeverity.Error,
"always",
[
"build",
"ci",
"chore",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"style",
"test",
],
],
},
} satisfies UserConfig;