惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LangChain Blog
阮一峰的网络日志
阮一峰的网络日志
WordPress大学
WordPress大学
博客园 - 司徒正美
罗磊的独立博客
D
Docker
Last Week in AI
Last Week in AI
爱范儿
爱范儿
M
MIT News - Artificial intelligence
V
V2EX
Google DeepMind News
Google DeepMind News
小众软件
小众软件
Apple Machine Learning Research
Apple Machine Learning Research
Microsoft Security Blog
Microsoft Security Blog
T
Tailwind CSS Blog
MyScale Blog
MyScale Blog
V
Visual Studio Blog
博客园 - 叶小钗
B
Blog RSS Feed
A
About on SuperTechFans
F
Fortinet All Blogs
T
The Blog of Author Tim Ferriss
Martin Fowler
Martin Fowler
P
Proofpoint News Feed

Hacker News: Show HN

PurrrrrFocus: Pomodoro Timer App - App Store Workflow Engine — Multi-Step Orchestration for Bun RapidPhoto: Pro Photo Editor App - App Store GitHub - DheerG/swarms: Achieve extraordinary results with claude code across a variety of tasks SPICE simulation → oscilloscope → verification with Claude Code — Lucas Gerads Show HN: VCoding – A 5 MB native Windows IDE with no dynamic dependencies Show HN: LLMs don't hallucinate because they're bad at math, it's the format GitHub - Agent-FM/agentfm-core: AgentFM is a peer-to-peer network that turns everyday computers into a decentralized AI supercomputer. AgentFM lets you run massive AI workloads directly across a global mesh of idle CPUs and GPUs. Show HN: Tracking Top US Science Olympiad Alumni over Last 25 Years GitHub - Potarix/agent-hub: One place to talk to all your agents Show HN: Runtime security for AI agents(injection,tool abuse, data exfiltration) GitHub - dubeyKartikay/lazyspotify: Terminal Spotify client for macOS and Linux GitHub - the-banana-tool/king-louie: Easy to use GUI Personal AI Assistant. Win/Linux/Mac. Show HN I made my vacation rental bookable by AI agents–no Airbnb, 0% commission GitHub - basteez/jsf-autoreload: maven plugin to enable hot reload on jsf projects uvm32/hosts/host-gdbstub at main · ringtailsoftware/uvm32 GitHub - labsai/EDDI: Config-driven engine that turns JSON into production-grade AI agents. Multi-agent orchestration, 12+ LLM providers, MCP/A2A protocols, RAG, persistent memory, and enterprise compliance (EU AI Act, GDPR, HIPAA). Built on Quarkus. GitHub - glitchnsec/fortyone-oss: AI Executive Assistant Platform Quickstart | Alien GitHub - muxshed/shed: One stream in, or many. Every destination, simultaneously. No cloud middleman, no per-channel fees, no limits. GitHub - ocrbase-hq/ocrbase: 📄 PDF/IMG ->.MD/JSON Document OCR API for PaddleOCR and GLMOCR. Self-hostable. GitHub - impactjo/home-memory: MCP server that lets your AI assistant remember everything about your home. GitHub - Sets88/dbcls: DbCls is a powerful terminal database client that supports various databases GitHub - neptun2000/heor-agent-mcp GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh RollQuation: Math Puzzles - Apps on Google Play GitHub - dropbox/witchcraft Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis GitHub - opentalon/opentalon: OpenTalon is an open-source platform built from the ground up in Go as a robust alternative to OpenClaw LinkedIn™ 职位抓取工具 - Chrome 应用商店
GitHub - oleg-koval/drop-em-dash-eslint-rule: ESLint plug...
orthodoz · 2026-04-23 · via Hacker News: Show HN

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