-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcommitlint.config.ts
More file actions
27 lines (25 loc) · 889 Bytes
/
commitlint.config.ts
File metadata and controls
27 lines (25 loc) · 889 Bytes
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
// Even if we augment the module below within the directory ./types, commitlint's `ts-node` does not see it due to its own config.
// That's why `ts-ignore` is needed here.
// @ts-ignore
import { utils } from '@commitlint/config-nx-scopes';
const config = {
extends: ['@commitlint/config-conventional'],
rules: {
'footer-empty': [0],
'header-max-length': [2, 'always', 100],
'references-empty': [0],
'scope-case': [2, 'always', 'kebab-case'],
'scope-empty': [2, 'never'],
'scope-enum': (async (context: any) => [
2,
'always',
[...(await utils.getProjects(context)), 'global'],
]) as any, // NOTE It seems like commitlint rules have wrong types when we use functions with a context
'type-enum': [
2,
'always',
['build', 'ci', 'deps', 'docs', 'feat', 'fix', 'refactor', 'test'],
],
},
};
export default config;