Registry / testing / prettier-plugin-sentences-per-line

prettier-plugin-sentences-per-line

JSON →
library0.2.3jsnpmunverified

A Prettier plugin that enforces a maximum of one sentence per line in Markdown files. Current stable version is 0.2.3, with frequent releases. It uses the sentences-per-line core to parse sentence boundaries and supports custom abbreviations. Unlike the ESLint or markdownlint counterparts, this plugin integrates directly into the Prettier formatting pipeline, automatically fixing line breaks. It requires Prettier 3 and ships with TypeScript declarations.

npm install prettier-plugin-sentences-per-line
INSTALL
IMPORT
SIG · PRETTIER-PLUGIN-SE
P
prettier-plugin-sentences-per-line
testingjavascriptv0.2.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import prettierPluginSentencesPerLine from 'prettier-plugin-sentences-per-line'
const prettierPlugin = require('prettier-plugin-sentences-per-line')
CommonJS require is not supported; the plugin is ESM-only. Use import statement.
plugin
plugins: ['prettier-plugin-sentences-per-line']
plugins: ['./node_modules/prettier-plugin-sentences-per-line']
Use the bare package name in Prettier config – Prettier resolves it automatically.
sentencesPerLineAdditionalAbbreviations
sentencesPerLineAdditionalAbbreviations: ['I.M.']
additionalAbbreviations: ['I.M.']
The option key must be exactly 'sentencesPerLineAdditionalAbbreviations'. Misspelling or using a different key will be ignored.

Configures Prettier with the plugin and an additional abbreviation, then shows formatting result splitting multi-sentence lines.

// .prettierrc.json { "plugins": ["prettier-plugin-sentences-per-line"], "sentencesPerLineAdditionalAbbreviations": ["e.g.", "i.e."] } // Input Markdown: // First sentence. Second sentence. // Third sentence. // // After formatting via `npx prettier --write input.md`: // First sentence. // Second sentence. // Third sentence.
Debug
Known issues
breakingPlugin requires Prettier ^3. Prettier 2.x is not supported.
fix
Upgrade Prettier to version 3 or later.
affects: >=0.1.0
gotchaThe plugin is ESM-only; CommonJS require('prettier-plugin-sentences-per-line') will fail.
fix
Use dynamic import() or switch to ESM. If using module.require, it will error.
affects: >=0.1.0
gotchaOption key must be exactly 'sentencesPerLineAdditionalAbbreviations'. Any other casing or typo will be silently ignored.
fix
Use the exact key name as documented.
affects: >=0.1.0
gotchaThe plugin only operates on Markdown files (.md). Other file types are ignored.
fix
Ensure your file extensions are .md or configure Prettier overrides.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'prettier-plugin-sentences-per-line'
The package is not installed or is not in node_modules.
fix
Run `npm install -D prettier-plugin-sentences-per-line` and ensure it's in devDependencies.
Unexpected token 'export'
CommonJS environment (e.g., .prettierrc.cjs with require) importing an ESM-only plugin.
fix
Convert your Prettier config to ESM (use .prettierrc.mjs) or use dynamic import: `module.exports = { plugins: [await import('prettier-plugin-sentences-per-line')] }`
Upgrade
Version history
0.2.3latest on npm
Audit
Dependencies
prettierrequiredPeer dependency – the plugin requires Prettier ^3 to function.
Agent activity
14 hits · last 30 days
node
12
Amazon
1
Resources
prettier-plugin-sentences-per-line — npm install prettier-plugin-sentences-per-line · libregistry