forked from telus/tds-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommitlint.config.js
35 lines (31 loc) · 1.06 KB
/
commitlint.config.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
// Rules Guide: http://marionebl.github.io/commitlint/#/reference-rules
// If touching a component/package, use that as the scope: feat(core-button): ... or chore(shared-animations): ...
// If not, use the most directly affected folder: test(e2e): ...
// Use "dependencies" when adding/removing/updating dependencies: chore(dependencies): ...
// Many of the files in the root are configuration files that would also use the "config" scope, such as ".babelrc" or "commitlint.config.js"
// If nothing else fits, use "other": chore(other): ...
const packages = require('@commitlint/config-lerna-scopes')
const applyCustomScope = () => {
const customScope = packages.rules[`scope-enum`]()[2]
customScope.push(
'config',
'dependencies',
'docs',
'e2e',
'github',
'guide',
'openshift',
'other',
'scripts',
'shared'
)
return customScope
}
module.exports = {
extends: ['@commitlint/config-conventional'],
utils: { applyCustomScope },
rules: {
'scope-enum': [2, 'always', applyCustomScope()],
'scope-empty': [2, 'never'],
},
}