-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommitlint.config.ts
More file actions
33 lines (30 loc) · 1.21 KB
/
commitlint.config.ts
File metadata and controls
33 lines (30 loc) · 1.21 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
import type { UserConfig } from '@commitlint/types';
import { RuleConfigSeverity } from '@commitlint/types';
async function getConfig(): Promise<UserConfig> {
const nxScopesConfig = await import('@commitlint/config-nx-scopes');
const { getProjects } = nxScopesConfig.default.utils;
return {
extends: ['@commitlint/config-conventional'],
// Ignore system-generated commits (Copilot agent placeholders, GitHub web editor defaults)
ignores: [
(commit) => /^Initial plan(\n|$)/.test(commit),
(commit) => /^Update \S+\.\w+(\n|$)/.test(commit),
],
rules: {
// Allow commits without scope (for global repo changes like "ci: update workflow")
// Disabled (0) to fully allow scope-less commits without warnings
'scope-empty': [RuleConfigSeverity.Disabled],
'scope-enum': async (ctx) => [
RuleConfigSeverity.Error,
'always',
[
...(await getProjects(ctx)),
'release', // Allow release commits (e.g. chore(release): ...)
'deps', // Allow dependency update commits (e.g. chore(deps): ...)
'commitlint', // Allow commits scoped to commitlint configuration changes
],
],
},
};
}
export default getConfig();