Skip to content

no-emoji

⭐ CommonMark 🌟 GFM

🔗 Rule Source 🔗 Test Source

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:

md
<!-- eslint mark/no-emoji: 'error' -->

Smiley 
😃
Unicorn
🦄
+1
👍

✅ Correct

Examples of correct code for this rule:

md
<!-- eslint mark/no-emoji: 'error' -->

Smiley :smiley:
Unicorn :unicorn:
+1 :+1:

Options

No options are available for this rule.

Limitations

This rule uses /\p{RGI_Emoji}/gv internally to match emojis. Unicode property escapes rely on the Unicode data/version supported by the runtime, so matches can vary across environments. Also, RGI_Emoji targets only Unicode's "Recommended for General Interchange" emoji set, so it may not match some non-RGI or emoji-like sequences.