Skip to content

Commit b67da04

Browse files
committed
chore: use commitlint
1 parent 7b1a372 commit b67da04

File tree

1 file changed

+107
-0
lines changed

1 file changed

+107
-0
lines changed

commitlint.config.js

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
module.exports = {
2+
parserPreset: 'conventional-changelog-conventionalcommits',
3+
rules: {
4+
'body-leading-blank': [1, 'always'],
5+
'body-max-line-length': [2, 'always', 100],
6+
'footer-leading-blank': [1, 'always'],
7+
'footer-max-line-length': [2, 'always', 100],
8+
'header-max-length': [2, 'always', 100],
9+
'subject-case': [2, 'never', ['sentence-case', 'start-case', 'pascal-case', 'upper-case']],
10+
'subject-empty': [2, 'never'],
11+
'subject-full-stop': [2, 'never', '.'],
12+
'type-case': [2, 'always', 'lower-case'],
13+
'type-empty': [2, 'never'],
14+
'type-enum': [2, 'always', ['build', 'chore', 'ci', 'docs', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style', 'test']],
15+
},
16+
prompt: {
17+
questions: {
18+
type: {
19+
description: "Select the type of change that you're committing",
20+
enum: {
21+
feat: {
22+
description: 'A new feature',
23+
title: 'Features',
24+
emoji: '✨',
25+
},
26+
fix: {
27+
description: 'A bug fix',
28+
title: 'Bug Fixes',
29+
emoji: '🐛',
30+
},
31+
docs: {
32+
description: 'Documentation only changes',
33+
title: 'Documentation',
34+
emoji: '📚',
35+
},
36+
style: {
37+
description: 'Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)',
38+
title: 'Styles',
39+
emoji: '💎',
40+
},
41+
refactor: {
42+
description: 'A code change that neither fixes a bug nor adds a feature',
43+
title: 'Code Refactoring',
44+
emoji: '📦',
45+
},
46+
perf: {
47+
description: 'A code change that improves performance',
48+
title: 'Performance Improvements',
49+
emoji: '🚀',
50+
},
51+
test: {
52+
description: 'Adding missing tests or correcting existing tests',
53+
title: 'Tests',
54+
emoji: '🚨',
55+
},
56+
build: {
57+
description: 'Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)',
58+
title: 'Builds',
59+
emoji: '🛠',
60+
},
61+
ci: {
62+
description: 'Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)',
63+
title: 'Continuous Integrations',
64+
emoji: '⚙️',
65+
},
66+
chore: {
67+
description: "Other changes that don't modify src or test files",
68+
title: 'Chores',
69+
emoji: '♻️',
70+
},
71+
revert: {
72+
description: 'Reverts a previous commit',
73+
title: 'Reverts',
74+
emoji: '🗑',
75+
},
76+
},
77+
},
78+
scope: {
79+
description: 'What is the scope of this change (e.g. component or file name)',
80+
},
81+
subject: {
82+
description: 'Write a short, imperative tense description of the change',
83+
},
84+
body: {
85+
description: 'Provide a longer description of the change',
86+
},
87+
isBreaking: {
88+
description: 'Are there any breaking changes?',
89+
},
90+
breakingBody: {
91+
description: 'A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself',
92+
},
93+
breaking: {
94+
description: 'Describe the breaking changes',
95+
},
96+
isIssueAffected: {
97+
description: 'Does this change affect any open issues?',
98+
},
99+
issuesBody: {
100+
description: 'If issues are closed, the commit requires a body. Please enter a longer description of the commit itself',
101+
},
102+
issues: {
103+
description: 'Add issue references (e.g. "fix #123", "re #123".)',
104+
},
105+
},
106+
},
107+
}

0 commit comments

Comments
 (0)