-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.commitlintrc.js
49 lines (41 loc) · 1.26 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
// @ts-check
const { readdirSync } = require('fs');
const { resolve } = require('path');
const makeScopeTypesByPath = (path) => {
const files = readdirSync(resolve(__dirname, path), { withFileTypes: true });
const directories = files.filter((file) => file.isDirectory());
return directories.map((dir) => dir.name);
};
/** @type {import('@commitlint/types').UserConfig} */
const config = {
extends: ['@commitlint/config-conventional'],
rules: {
'header-max-length': [2, 'always', 120],
'scope-enum': [
2,
'always',
[
...makeScopeTypesByPath(resolve(__dirname, 'apps')),
...makeScopeTypesByPath(resolve(__dirname, 'packages/components')),
// packages
'angular-luxon-adapter',
'angular-moment-adapter',
'cdk',
'cli',
'experimental',
'schematics',
'dev',
// core
'common',
'formatter',
'layout',
'overlay',
'typography',
// others
'security',
'visual'
]
]
}
};
module.exports = config;