npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

eslint-plugin-unicode-comments

v2.0.1

Published

ESLint plugin for Unicode security checks to prevent various Unicode-based attacks

Downloads

196

Readme

eslint-plugin-unicode-comments

A comprehensive ESLint plugin that provides Unicode security checks to prevent various Unicode-based attacks and ensure code safety.

Installation

From npm (when published)

npm install eslint-plugin-unicode-comments --save-dev

Local Development Installation

# Install locally from project directory
npm install /path/to/eslint-plugin-unicode-comments

# Example:
npm install /Users/af/Developer/private/eslint-plugin-unicode-comments

Usage

ESLint 9+ (Flat Config)

// eslint.config.js (CommonJS style)
const unicodeCommentsPlugin = require("eslint-plugin-unicode-comments");

module.exports = [
  {
    plugins: {
      "unicode-comments": unicodeCommentsPlugin,
    },
    rules: {
      "unicode-comments/dangerous-unicode": "error",
      "unicode-comments/dangerous-unicode-literals": "error",
      "unicode-comments/dangerous-unicode-template-literals": "error",
      "unicode-comments/dangerous-unicode-identifiers": "error",
    },
  },
];

ESLint 8 and below (Legacy Config)

// .eslintrc.js
module.exports = {
  plugins: ["unicode-comments"],
  rules: {
    "unicode-comments/dangerous-unicode": "error",
    "unicode-comments/dangerous-unicode-literals": "error",
    "unicode-comments/dangerous-unicode-template-literals": "error",
    "unicode-comments/dangerous-unicode-identifiers": "error",
  },
};

Using Recommended Config

// ESLint 8 and below (Legacy Config)
module.exports = {
  extends: ["plugin:unicode-comments/recommended"],
};

// Note: Flat Config (ESLint 9+) doesn't support extends syntax
// Use the explicit rules configuration above instead

Rules

  • dangerous-unicode: Detects dangerous Unicode characters in comments
  • dangerous-unicode-literals: Prevents dangerous Unicode in string literals
  • dangerous-unicode-template-literals: Blocks dangerous Unicode in template literals
  • dangerous-unicode-identifiers: Identifies dangerous Unicode in identifiers

Features

  • Trojan Source attack prevention
  • Homograph attack detection
  • Unicode hyphen/dash blocking
  • Invisible character detection
  • Mathematical symbol blocking
  • Fullwidth ASCII variant prevention
  • Unicode quotation mark blocking

Blocked Characters

The plugin blocks the following dangerous Unicode characters:

Hyphens and Dashes:

  • (en dash, U+2013) → -
  • (em dash, U+2014) → --
  • (hyphen, U+2010) → -
  • (non-breaking hyphen, U+2011) → -
  • (figure dash, U+2012) → -
  • (horizontal bar, U+2015) → --
  • (minus sign, U+2212) → -
  • (small em dash, U+FE58) → -
  • (small hyphen-minus, U+FE63) → -
  • (fullwidth hyphen-minus, U+FF0D) → -

Quotation Marks:

  • ' (left single quotation mark, U+2018) → '
  • ' (right single quotation mark, U+2019) → '
  • " (left double quotation mark, U+201C) → "
  • " (right double quotation mark, U+201D) → "
  • (single low-9 quotation mark, U+201A) → ,
  • (double low-9 quotation mark, U+201E) → ,,
  • (single left-pointing angle quotation mark, U+2039) → <
  • (single right-pointing angle quotation mark, U+203A) → >

Development

# Install dependencies
npm install

# Build TypeScript to JavaScript
npm run build

# Run tests
npm test

# Lint source code
npm run lint

Local Development Workflow

# 1. Make changes to source code
# 2. Build the plugin
npm run build

# 3. Install locally in consumer project
cd /path/to/consumer-project
npm install /path/to/eslint-plugin-unicode-comments

# 4. Test the plugin
npx eslint path/to/test-file.js

# 5. Use --fix to test auto-fixing
npx eslint path/to/test-file.js --fix

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request