@@ -39,14 +39,105 @@ In package.json
39
39
40
40
``` bash
41
41
# Install commitlint cli and conventional config
42
- npm install --save-dev @commitlint/config-conventional @commitlint/cli
42
+ npm install --save-dev @commitlint/config-conventional @commitlint/cli commitlint-config-gitmoji
43
43
# or yarn
44
- yarn add @commitlint/config-conventional @commitlint/cli -D
44
+ yarn add @commitlint/config-conventional @commitlint/cli commitlint-config-gitmoji -D
45
45
46
46
# Simple: config with conventional
47
- echo " module.exports = {extends: ['@commitlint/config-conventional']};" > commitlint.config.js
47
+ import { UserConfig } from " @commitlint/types" ;
48
+ import gitmoji from ' commitlint-config-gitmoji'
49
+
50
+ /**
51
+ * @type {import(' @commitlint/types' ).UserConfig}
52
+ * / for .js file
53
+ module.exports = {
54
+ extends: [' @commitlint/config-conventional' ],
55
+ prompt: {
56
+ questions: {
57
+ type: {
58
+ description: " Select the type of change that you're committing" ,
59
+ enum: {
60
+ feat: {
61
+ description: " A new feature" ,
62
+ title: " Features" ,
63
+ emoji: " ✨" ,
64
+ },
65
+ fix: {
66
+ description: " A bug fix" ,
67
+ title: " Bug Fixes" ,
68
+ emoji: " 🐛" ,
69
+ },
70
+ docs: {
71
+ description: " Documentation only changes" ,
72
+ title: " Documentation" ,
73
+ emoji: " 📚" ,
74
+ },
75
+ style: {
76
+ description:
77
+ " Changes that do not affect the meaning of the code (linters)" ,
78
+ title: " Styles" ,
79
+ emoji: " 🎨" ,
80
+ },
81
+ refactor: {
82
+ description:
83
+ " A code change that neither fixes a bug nor adds a feature" ,
84
+ title: " Code Refactoring" ,
85
+ emoji: " 📦" ,
86
+ },
87
+ perf: {
88
+ description: " A code change that improves performance" ,
89
+ title: " Performance Improvements" ,
90
+ emoji: " 🚀" ,
91
+ },
92
+ test: {
93
+ description: " Adding missing tests or correcting existing tests" ,
94
+ title: " Tests" ,
95
+ emoji: " 🚨" ,
96
+ },
97
+ build: {
98
+ description:
99
+ " Changes that affect the build system or external dependencies (yarn)" ,
100
+ title: " Builds" ,
101
+ emoji: " 🏗️ " ,
102
+ },
103
+ ci: {
104
+ description:
105
+ " Changes to our CI configuration files and scripts (GitActions)" ,
106
+ title: " Continuous Integrations" ,
107
+ emoji: " ⚙️ " ,
108
+ },
109
+ chore: {
110
+ description: " Other changes that don't modify src or test files" ,
111
+ title: " Chores" ,
112
+ emoji: " ♻️ " ,
113
+ },
114
+ revert: {
115
+ description: " Reverts a previous commit" ,
116
+ title: " Reverts" ,
117
+ emoji: " ⏪" ,
118
+ },
119
+ },
120
+ },
121
+ },
122
+ },
123
+ parserPreset: {
124
+ parserOpts: gitmoji.parserPreset.parserOpts,
125
+ plugins: [gitmoji.parserPreset.plugins],
126
+ },
127
+ ...gitmoji.rules,
128
+ ...gitmoji.plugins
129
+ } as UserConfig
48
130
` ` `
49
131
132
+ ` ` ` json
133
+ .czrc
134
+
135
+ {
136
+ " path" : " @commitlint/cz-commitlint" ,
137
+ " useGitmojis" : true
138
+ }
139
+
140
+ ` ` `
50
141
# ## Try it out
51
142
52
143
` ` ` bash
0 commit comments