|
1 |
| -import { commitlintGitHubConstants } from 'commitlint-github-utils'; |
| 1 | +import { When } from 'commitlint-github-utils/@types'; |
| 2 | +import utils from 'commitlint-github-utils'; |
2 | 3 | import { CommitlintConfigGitHub } from '../@types';
|
3 | 4 |
|
| 5 | +const commitlintGitHubRules = utils.commitlintGitHubConstants.GITHUB_RULES; |
| 6 | + |
| 7 | +const supportedTypes = [ |
| 8 | + 'build', |
| 9 | + 'chore', |
| 10 | + 'ci', |
| 11 | + 'docs', |
| 12 | + 'feat', |
| 13 | + 'feature', // Additional one for those who prefer a full word |
| 14 | + 'fix', |
| 15 | + 'improvement', |
| 16 | + 'perf', |
| 17 | + 'refactor', |
| 18 | + 'revert', |
| 19 | + 'style', |
| 20 | + 'test', |
| 21 | +]; |
| 22 | + |
4 | 23 | export const commitlintConfigGitHub: CommitlintConfigGitHub = {
|
5 | 24 | rules: {
|
6 |
| - [commitlintGitHubConstants.GITHUB_RULES.issueNumberMissing]: [2, 'always', true], |
7 |
| - [commitlintGitHubConstants.GITHUB_RULES.issueNumberFormat]: [2, 'always'], |
| 25 | + [commitlintGitHubRules.issueNumberMissing]: [2, When.NEVER], |
| 26 | + [commitlintGitHubRules.issueNumberFormat]: [2, When.ALWAYS], |
| 27 | + [commitlintGitHubRules.issueNumberDuplicate]: [2, When.NEVER], |
| 28 | + |
| 29 | + [commitlintGitHubRules.wipAllowed]: [2, When.ALWAYS], |
| 30 | + |
| 31 | + [commitlintGitHubRules.subjectEmpty]: [2, When.NEVER], |
| 32 | + [commitlintGitHubRules.subjectSeparator]: [2, When.ALWAYS], |
| 33 | + [commitlintGitHubRules.subjectCase]: [2, When.ALWAYS, 'sentence-case'], |
| 34 | + [commitlintGitHubRules.subjectFullStop]: [1, When.ALWAYS], // Warning only |
| 35 | + |
| 36 | + [commitlintGitHubRules.typeCase]: [2, When.ALWAYS, 'lower-case'], |
| 37 | + [commitlintGitHubRules.typeEnum]: [2, When.ALWAYS, supportedTypes], |
8 | 38 | },
|
9 | 39 | };
|
10 | 40 |
|
|
0 commit comments