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-em-dash-checker

v1.0.0

Published

ESLint plugin to detect and suggest replacements for em-dash characters

Readme

eslint-plugin-em-dash-checker

"Why does this code read like it was written by a 19th-century novelist?" — Your code reviewer, probably

ESLint plugin to detect em-dash characters (—) and suggest replacements.

Why?

Let's be honest. You're here for one of two reasons:

1. You're using AI coding assistants

AI models love em-dashes. They can't help themselves. It's like their typographical comfort food. Every time an AI writes a comment or a string, there's a solid chance it'll sneak in an em-dash like it's penning a Victorian novel.

// This function calculates the user's balance — and updates the ledger
//                                             ↑
//                                    "I see you, robot"

If you're trying to keep your AI-assisted code on the down-low, em-dashes are a dead giveaway. This plugin helps you maintain plausible deniability. Your secret is safe with us.

2. You copy-paste from documentation, Slack, or Word

Em-dashes sneak into your code from word processors, rich text editors, and that one colleague who thinks Slack messages need typographical flair. They can cause subtle bugs, break string comparisons, and make grep sad.

Either way, this plugin has your back.

Installation

npm install --save-dev eslint-plugin-em-dash-checker

Usage

Flat Config (ESLint 9+) - Recommended

// eslint.config.mjs
import emDashChecker from 'eslint-plugin-em-dash-checker';

export default [
  // Use the recommended config
  ...emDashChecker.configs.recommended,

  // Or configure manually:
  {
    plugins: {
      'em-dash-checker': emDashChecker,
    },
    rules: {
      'em-dash-checker/no-em-dash': 'warn', // or 'error'
    },
  },
];

Legacy Config (ESLint 8)

{
  "plugins": ["em-dash-checker"],
  "extends": ["plugin:em-dash-checker/legacy-recommended"]
}

Or configure manually:

{
  "plugins": ["em-dash-checker"],
  "rules": {
    "em-dash-checker/no-em-dash": "warn"
  }
}

Rules

| Rule | Description | |------|-------------| | no-em-dash | Disallow em-dash characters |

What Gets Checked

We hunt em-dashes everywhere they hide:

  • String literals - "hello—world"
  • Template literals - `hello—world`
  • JSX text - <div>hello—world</div>
  • Line comments - // hello—world
  • Block comments - /* hello—world */

No em-dash escapes. Not one.

Suggestions

This rule provides suggestions (not auto-fix) so you can choose the appropriate replacement:

  • - Single hyphen (the classic)
  • -- Double hyphen (for the dramatic pause)
  • --- Triple hyphen (calm down, markdown)
  • - Spaced hyphen (breathe)
  • Remove entirely (it was never meant to be)

In VS Code and other editors with ESLint integration, you'll see these options in the quick-fix menu (lightbulb icon). Click, choose, and your code will look like a human wrote it.

CI Integration

Catch em-dashes before they hit production. Because nothing says "this was AI-generated" like an em-dash in a commit message.

GitHub Actions

name: Lint
on: [push, pull_request]
jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
      - run: npm ci
      - run: npx eslint . --max-warnings 0

Pre-commit Hook (with Husky)

npx husky add .husky/pre-commit "npx eslint . --max-warnings 0"

Pre-commit Hook (with lint-staged)

{
  "lint-staged": {
    "*.{js,jsx,ts,tsx}": "eslint --max-warnings 0"
  }
}

FAQ

Q: Is this plugin AI-generated? A: We can neither confirm nor deny. But you'll notice there are no em-dashes in this README.

Q: What about en-dashes? A: Those are fine. We're not monsters.

Q: Will this make my code look more human? A: It's one less tell. You're on your own for the rest.

License

MIT — wait, I mean MIT--no, just MIT.