@cffnpwr/textlint-rule-sentence-per-line

中文文档
1.2.1发布于 2026/10/25MITTypeScriptESM + CJS构建来源已验证近 30 天下载 1860

1行に複数の文が含まれている状態を検出するtextlintルール

原始使用文档
文档目录9 节
  1. How to Install
  2. npm
  3. yarn
  4. pnpm
  5. Bun
  6. Deno
  7. How to Use
  8. Options
  9. License

@cffnpwr/textlint-rule-sentence-per-line

GitHub License npm Version JSR Version

A textlint rule that detects lines containing more than one sentence.

日本語のREADMEはこちら

It enforces the style of "break the line after each sentence, and separate paragraphs with blank lines." The one-sentence-per-line format makes diffs sentence-scoped and easier to review.

<!-- NG -->
一文目です。二文目です。

<!-- OK -->
一文目です。
二文目です。

Sentence boundaries are determined by sentence-splitter. It does not split on "。" inside quotation marks or parentheses, or on the period in abbreviations such as Node.js. A single sentence wrapped across multiple lines at a comma or similar is not a violation.

Only paragraphs are inspected. Headings, inline code, and code blocks are excluded. Text inside list items and quotes is also excluded by default, and can be included with the skipListItem and skipBlockQuote options.

When a line has two or more sentences, each sentence from the second onward is reported.

This rule supports autofixing with textlint --fix. Each fix inserts a line break at the sentence boundary. When skipListItem is false, the continuation line inside a list item is indented to match the item's own indentation, so the fix does not fall back on lazy continuation.

How to Install

npm

npm install --save-dev @cffnpwr/textlint-rule-sentence-per-line

or

npx jsr add -D @cffnpwr/textlint-rule-sentence-per-line

yarn

yarn add --dev @cffnpwr/textlint-rule-sentence-per-line

or

yarn dlx jsr add -D @cffnpwr/textlint-rule-sentence-per-line

pnpm

pnpm add --save-dev @cffnpwr/textlint-rule-sentence-per-line

or

pnpm dlx jsr add -D @cffnpwr/textlint-rule-sentence-per-line

Bun

bun add --dev @cffnpwr/textlint-rule-sentence-per-line

or

bunx jsr add -D @cffnpwr/textlint-rule-sentence-per-line

Deno

deno add --dev npm:@cffnpwr/textlint-rule-sentence-per-line

or

deno add --dev jsr:@cffnpwr/textlint-rule-sentence-per-line

How to Use

Add it to .textlintrc.json.

{
  "rules": {
    "@cffnpwr/textlint-rule-sentence-per-line": true
  }
}

Options

interface Options {
  skipBlockQuote?: boolean;
  skipListItem?: boolean;
}
OptionDefaultDescription
skipBlockQuotetrueExcludes content under quotes (BlockQuote) from inspection
skipListItemtrueExcludes content under list items (ListItem), including nested lists, from inspection

Specifying an unknown option key or an invalid value results in an error.

License

MIT

版本与发布记录

@cffnpwr/textlint-rule-sentence-per-line 共发布 8 个版本,首次发布于 2026/07/12;过去 12 个月发布了 8 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.2.1latest2026/10/2516 天前
1.2.02026/10/2416 天前
1.1.02026/08/033 个月前
1.0.52026/07/133 个月前
1.0.42026/07/133 个月前
1.0.32026/07/123 个月前

关于 @cffnpwr/textlint-rule-sentence-per-line 的常见问题

@cffnpwr/textlint-rule-sentence-per-line 是什么?

1行に複数の文が含まれている状態を検出するtextlintルール

如何安装 @cffnpwr/textlint-rule-sentence-per-line?

在项目目录运行 npm install @cffnpwr/textlint-rule-sentence-per-line,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:textlint(>=15.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@cffnpwr/textlint-rule-sentence-per-line 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@cffnpwr/textlint-rule-sentence-per-line 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@cffnpwr/textlint-rule-sentence-per-line 可以商用吗?

@cffnpwr/textlint-rule-sentence-per-line 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@cffnpwr/textlint-rule-sentence-per-line 的下载量有多少?

根据 npm 官方下载统计,@cffnpwr/textlint-rule-sentence-per-line 在 2026/10/10 – 2026/11/08 这 30 天内被下载 1,860 次,日均约 62 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@cffnpwr/textlint-rule-sentence-per-line 还在维护吗?

最新版本 1.2.1 发布于 2026/10/25(16 天前);至今共发布 8 个版本,其中过去 12 个月发布了 8 个;首次发布于 2026/07/12。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。