Automatically sync emojis list
See original GitHub issueHey, this lib becomes out of sync whenever gitmoji adds a new emoji. Here’s how I managed to solve the problem.
- Add gitmoji to the dev dependencies. Unfortunately gitmoji is not available from NPM, so we must point to the GitHub repo.
"gitmoji": "carloscuesta/gitmoji",
- Change the commitlint config file:
const { gitmojis } = require('gitmoji/src/data/gitmojis.json')
const allGitmojiCodes = gitmojis.map(gitmoji => gitmoji.code)
module.exports = {
rules: {
'type-enum': [2, 'always', allGitmojiCodes],
What do you think? Would you like a PR?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Automatically Controlled Emoji-List - Pepe Manager Docs
The first thing you want to do is create a channel for your emoji list. This will be the final channel, so set...
Read more >Use emoji and symbols on Mac - Apple Support
On your Mac, enter emoji, symbols, and other special characters using the Character ... To change the categories shown in the viewer, choose...
Read more >Adding Emojis to Outlook's AutoCorrect - Slipstick Systems
Find the Emoji you want to use and copy it. · Open the Autocorrect dialog (File, Options, Mail, Spelling and Autocorrect, AutoCorrect Options)....
Read more >Why am I seeing emojis under my "frequently used" section ...
The list of frequently used emoji is literally a list of emojis that you've used most often. This list does not synchronise over...
Read more >Use emoji and reactions - Slack
An emoji reaction can often replace the need for a follow-up message. You can hover over or tap and hold reactions in a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Downside of the approach above is that it will install all dependencies from the gitmoji repository. Almost doubled the contents of my yarn.lock file 😨.
I have another idea. We can download the gitmojis.json file from GitHub and place it in
os.tmpdir()
. Next time, if the file already exists, skip the download.Now in order to update the list of emojis the user only needs to
rm /tmp/gitmojis.json
(so that it’ll be downloaded again next time commitlint runs). Or maybe we should keep the file atjoin(__dirname, 'gitmojis.json') // => "node_modules/commitlint-config-gitmoji/gitmojis.json"
so that deleting the node_modules folder will also delete it (which seems to be what users would expect).The second approach is better in my opinion