no-emoji
⭐ CommonMark
🌟 GFM
Disallow emojis in text.
Rule Details
Some websites and Markdown parsers handle emojis natively or provide their own plugins for support. Instead of using raw emojis like 😃, you can use the :smiley:-style shortcode syntax, which places colons around the emoji name.
The main purpose of this rule is to discourage the use of raw (Unicode) emojis in Markdown files and encourage the use of the :smiley:-style shortcode syntax for better:
- Cross-platform rendering consistency
- Accessibility (screen readers can receive clearer text equivalents)
- Diff readability (pure text instead of glyphs)
- Theming or post-processing (shortcodes are easier to map or replace)
For a full list of supported emojis, refer to:
Platforms like GitHub and Markdown plugins such as remark-emoji and markdown-it-emoji also support this shortcode feature.
Examples
❌ Incorrect
Examples of incorrect code for this rule:
<!-- eslint mark/no-emoji: "error" -->
Smiley 😃
Unicorn 🦄
+1 👍✅ Correct
Examples of correct code for this rule:
<!-- eslint mark/no-emoji: "error" -->
Smiley :smiley:
Unicorn :unicorn:
+1 :+1:Options
No options are available for this rule.
Limitations
This rule uses emoji-regex internally to match emojis. Any emoji not supported by the current version of that regex will not be detected (for example, very recent Unicode additions until the dependency is updated).