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

v1.0.1

Published

ESLint rule to disallow the em dash (—) and replace it with a hyphen (-).

Readme

eslint-plugin-drop-em-dash

Catch the em dash. The one character that screams “this was written by an LLM” (or pasted from a doc editor). Autofix it to a plain hyphen, in CI, everywhere.

npm version CI License: MIT ESLint

npm i -D eslint eslint-plugin-drop-em-dash
// eslint.config.js
import dropEmDash from 'eslint-plugin-drop-em-dash';

export default [...dropEmDash.configs['flat/recommended']];
eslint . --fix

Done. No more - sneaking into your commits, comments, strings, or JSX copy.

This rule flags a Unicode character (U+2014) - it does not infer authorship. Plenty of humans use em dashes; the point here is consistency and ASCII in codebases that want it.

Why you need this

The Unicode em dash (-, U+2014) is a known punctuation tell of AI-generated text. It also leaks in constantly from:

  • ChatGPT / Claude / Gemini output pasted into code and docs
  • Notion, Google Docs, Word, Slack (they auto-convert -- to -)
  • Designers pasting marketing copy into JSX
  • macOS “smart punctuation” on by default

Once in your repo, it causes real problems:

  • Grep-unfriendly. grep -- patterns will not find -. Refactors can skip it.
  • Noisy diffs. Mixed dash styles break reviewers’ flow.
  • Inconsistent rendering across terminals, logs, emails, and error messages.
  • Copy drift. Marketing and UI strings drift toward LLM-default punctuation.
  • Not ASCII. Legacy tooling, logs, SMS, CSV, or email headers get weird.

This plugin is the smallest possible fix: one rule, one character, autofix on save. No config sprawl, no opinions about en dashes, no typography debate for your JS/TS tree - just ship ASCII where you lint.

What it does

  • Flags every literal - (U+2014) in files ESLint parses: code, comments, string literals, JSX text.
  • Autofixes each one to - (U+002D, hyphen-minus).
  • Ignores the en dash (U+2013) and other dash-like characters on purpose, so you can adopt it without a style war.

Usage

Flat config (ESLint 9+)

import dropEmDash from 'eslint-plugin-drop-em-dash';

export default [...dropEmDash.configs['flat/recommended']];

Manual:

import dropEmDash from 'eslint-plugin-drop-em-dash';

export default [
  {
    plugins: { 'drop-em-dash': dropEmDash },
    rules: { 'drop-em-dash/drop-em-dash': 'error' },
  },
];

Legacy .eslintrc.*

{
  "extends": ["plugin:drop-em-dash/recommended"]
}

Or wire the rule explicitly:

{
  "plugins": ["drop-em-dash"],
  "rules": {
    "drop-em-dash/drop-em-dash": "error"
  }
}

Other package managers

pnpm add -D eslint eslint-plugin-drop-em-dash
yarn add -D eslint eslint-plugin-drop-em-dash

Example

If a file contains a literal em dash (U+2014) between tokens (for example in a string or comment), eslint . --fix rewrites each occurrence to a hyphen-minus (-). See tests/fixtures/has-em-dash.cjs for a minimal file used in integration tests.

Illustrative after state:

const title = 'Pricing - overview'; // best plan - for teams

Requirements

  • Node.js ^18.18.0 || ^20.9.0 || >=21.1.0
  • ESLint >=8.57.0

Cursor / AI agent skill

This repo ships a Cursor skill so coding agents auto-discover how to install and wire the plugin: .cursor/skills/drop-em-dash-eslint/SKILL.md. Copy that folder to ~/.cursor/skills/drop-em-dash-eslint (or symlink) to enable globally - see root AGENTS.md. Fitting, since agents and doc tools are a common source of stray em dashes in code.

Docs

Full docs mirror: https://oleg-koval.github.io/drop-em-dash-eslint-rule/

The workflow .github/workflows/pages.yml bootstraps Pages (build_type: workflow) if needed, then deploys docs/. If Pages was disabled or pointed at a branch, use Settings → Pages → Source → GitHub Actions, or push again after the bootstrap step runs.

Testing

npm test
  • Unit tests - ESLint RuleTester for the rule.
  • Integration tests - real ESLint API over tests/fixtures/ (literal em dash) for diagnostics and autofix.

Releases (maintainers)

Pushes to main run .github/workflows/release.ymlsemantic-release after tests pass (Conventional Commits; release commits use [skip ci]).

Add repository secret NPM_TOKEN (npm automation or granular publish token). GITHUB_TOKEN covers GitHub Releases and the version bump push.

Contributing

See CONTRIBUTING.md and CODE_OF_CONDUCT.md.

License

MIT - see LICENSE.

Related