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 syntax, which places colons around the emoji name.

The purpose of this rule is to discourage the use of raw emojis in Markdown files and encourage the use of the :smiley:-style syntax for better compatibility.

For a full list of supported emojis, you can refer to the Emoji Cheat Sheet or emoji-cheat-sheet.

Platforms like GitHub and Markdown plugins such as remark-emoji and markdown-it-emoji also support this feature.

Examples

❌ Incorrect

Examples of incorrect code for this rule:

md
Smiley 😃

Unicorn 🦄

+1 👍
js
export default [
  // ...
  {
    rules: {
      'mark/no-emoji': 'error', 
    },
  },
  // ...
];

✅ Correct

Examples of correct code for this rule:

md
Smiley :smiley:

Unicorn :unicorn:

+1 :+1:
js
export default [
  // ...
  {
    rules: {
      'mark/no-emoji': 'error', 
    },
  },
  // ...
];

Limitations

This rule uses Emoji Regex internally to match emojis. Emojis that are not supported by this regex will not be detected by this rule.

Options

No options are available for this rule.

AST

This rule applies only to the Text node.