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

@cffnpwr/textlint-rule-no-dash

v1.1.0

Published

地の文・見出し・テーブルセルでのダッシュの使用を検出するtextlintルール

Readme

@cffnpwr/textlint-rule-no-dash

GitHub License npm Version JSR Version

A textlint rule that detects the use of dashes ( ) in body text, headings, and table cells.

日本語のREADMEはこちら

It encourages rewriting appositive or supplementary insertions with dashes (A——挿入——B) using parentheses(), and rephrasings (A——B) either by splitting them into two sentences with a full stop or by joining them with a comma.

<!-- NG -->
この機能——つまり自動保存——は便利です。
結論は明快—シンプルが最善です。

<!-- OK -->
この機能(自動保存)は便利です。
結論は明快です。シンプルが最善です。

By default, the en dash ( U+2013) is detected only when both sides are Japanese characters (hiragana, katakana, kanji, ー, 々). English compounds such as Curry–Howard and range notations such as 1–3月 are not detected.

Detection is performed on the body text with markup such as emphasis and links removed. Even when a dash sits on a markup boundary, as in **強調**–続き, the detection condition is judged by the surrounding body characters (「調」 and 「続」 in this example). Inline code, code blocks, HTML tags, images, and autolink (<https://…>) URLs do not have their internal dashes detected. These are replaced with dummy characters of the same length for the judgment, so in the Japanese-character check for adjacent dashes they are treated as non-Japanese characters (for example, the en dash in カリー–codeです。 is not detected because inline code immediately follows it). Links in the [表示テキスト](URL) form target the display text for detection, not the URL. Consecutive dashes (such as ——) are reported as a single error.

How to Install

npm

npm install --save-dev @cffnpwr/textlint-rule-no-dash

or

npx jsr add -D @cffnpwr/textlint-rule-no-dash

yarn

yarn add --dev @cffnpwr/textlint-rule-no-dash

or

yarn dlx jsr add -D @cffnpwr/textlint-rule-no-dash

pnpm

pnpm add --save-dev @cffnpwr/textlint-rule-no-dash

or

pnpm dlx jsr add -D @cffnpwr/textlint-rule-no-dash

Bun

bun add --dev @cffnpwr/textlint-rule-no-dash

or

bunx jsr add -D @cffnpwr/textlint-rule-no-dash

Deno

deno add --dev npm:@cffnpwr/textlint-rule-no-dash

or

deno add --dev jsr:@cffnpwr/textlint-rule-no-dash

How to Use

Add it to .textlintrc.json.

{
  "rules": {
    "@cffnpwr/textlint-rule-no-dash": true
  }
}

Options

type DashContext = "always" | "japanese-both" | "japanese-either";

interface Options {
  allows?: string[];
  dashes?: Partial<Record<"emDash" | "horizontalBar" | "enDash", DashContext>>;
  skipBlockQuote?: boolean;
}

| Option | Default | Description | | --- | --- | --- | | allows | [] | A list of strings or patterns to exclude from detection. In the regexp-string-matcher format, regular expressions can also be specified via "/pattern/". Detections overlapping a matched range are skipped | | dashes | see below | A map of dashes to detect and their detection conditions. When specified, it overrides the entire default (it is not merged per key) | | skipBlockQuote | true | Excludes content under quotes (BlockQuote) from inspection |

The keys of dashes and their corresponding characters are as follows.

| Key | Character | Default detection condition | | --- | --- | --- | | emDash | U+2014 | always | | horizontalBar | U+2015 | always | | enDash | U+2013 | japanese-both |

The meanings of the detection conditions (DashContext) are as follows.

| Value | Meaning | | --- | --- | | always | Detects unconditionally | | japanese-both | Detects only when both the preceding and following characters are Japanese | | japanese-either | Detects only when at least one of the preceding and following characters is Japanese |

Japanese characters refers to hiragana, katakana, kanji, the prolonged sound mark 「ー」, and 「々」. Specifying an unknown option key or an invalid value results in an error.

{
  "rules": {
    "@cffnpwr/textlint-rule-no-dash": {
      "allows": ["カリー–ハワード"],
      "dashes": {
        "emDash": "always",
        "horizontalBar": "always"
      }
    }
  }
}

License

MIT