oleg-koval

Drop Em Dash Eslint Rule — Code Quality skill for Claude Code

Code Quality community

ESLint plugin: disallow em dash (U+2014) and autofix to hyphen.

How to install Drop Em Dash Eslint Rule

This entry records only its repository, not the path inside it, so there is no exact command to give. Open oleg-koval/drop-em-dash-eslint-rule and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Drop Em Dash Eslint Rule does

ESLint plugin: disallow em dash (U+2014) and autofix to hyphen.

Alternatives in Code Quality

  • Auto Format Code — I'll format your code and fix TypeScript issues using the project's configured tools 77 ★
  • Flashcard Coverage Checker — Compare existing Anki flashcard decks against lecture source materials to identify uncovered topics and genera 2 ★
  • Prompt Integrity Validator — Lint Your Prompts, Ship Better Agents – Prompt Refiner 2026 Rule Engine 2 ★

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](https://img.shields.io/npm/v/eslint-plugin-drop-em-dash.svg)](https://www.npmjs.com/package/eslint-plugin-drop-em-dash) [![CI](https://github.com/oleg-koval/drop-em-dash-eslint-rule/actions/workflows/ci.yml/badge.svg)](https://github.com/oleg-koval/drop-em-dash-eslint-rule/actions/workflows/ci.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![ESLint](https://img.shields.io/badge/ESLint-9%2B-4b32c3?logo=eslint&logoColor=white)](https://eslint.org)

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 weir