包详细信息

sentences-per-line

JoshuaKGoldberg61.5kMIT0.5.0

Utility functions to detect the number of sentences per line in Markdown files. 📐

自述文件

sentences-per-line

Utility functions to enforce the number of sentences per line in Markdown files. 📐

🤝 Code of Conduct: Kept 📝 License: MIT 📦 npm version 💪 TypeScript: Strict

Usage

Looking for the ESLint, Markdownlint, or Prettier plugins to enforce sentences-per-line? See ../../README.md > ## Packages.

npm i sentences-per-line

getIndexBeforeSecondSentence

Retrieves the first index after the period of the line's first sentence, if a second sentence follows it. This is the driving function behind enforcing one sentence per line in the sentences-per-line monorepo's packages.

import { getIndexBeforeSecondSentence } from "sentences-per-line";

// undefined
getIndexBeforeSecondSentence("The only sentence.");

// 15
getIndexBeforeSecondSentence("First sentence. Second sentence.");