{"id":20414,"library":"prettier-plugin-sentences-per-line","title":"prettier-plugin-sentences-per-line","description":"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.","status":"active","version":"0.2.3","language":"javascript","source_language":"en","source_url":"https://github.com/JoshuaKGoldberg/sentences-per-line","tags":["javascript","typescript"],"install":[{"cmd":"npm install prettier-plugin-sentences-per-line","lang":"bash","label":"npm"},{"cmd":"yarn add prettier-plugin-sentences-per-line","lang":"bash","label":"yarn"},{"cmd":"pnpm add prettier-plugin-sentences-per-line","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency – the plugin requires Prettier ^3 to function.","package":"prettier","optional":false}],"imports":[{"note":"CommonJS require is not supported; the plugin is ESM-only. Use import statement.","wrong":"const prettierPlugin = require('prettier-plugin-sentences-per-line')","symbol":"default","correct":"import prettierPluginSentencesPerLine from 'prettier-plugin-sentences-per-line'"},{"note":"Use the bare package name in Prettier config – Prettier resolves it automatically.","wrong":"plugins: ['./node_modules/prettier-plugin-sentences-per-line']","symbol":"plugin","correct":"plugins: ['prettier-plugin-sentences-per-line']"},{"note":"The option key must be exactly 'sentencesPerLineAdditionalAbbreviations'. Misspelling or using a different key will be ignored.","wrong":"additionalAbbreviations: ['I.M.']","symbol":"sentencesPerLineAdditionalAbbreviations","correct":"sentencesPerLineAdditionalAbbreviations: ['I.M.']"}],"quickstart":{"code":"// .prettierrc.json\n{\n  \"plugins\": [\"prettier-plugin-sentences-per-line\"],\n  \"sentencesPerLineAdditionalAbbreviations\": [\"e.g.\", \"i.e.\"]\n}\n\n// Input Markdown:\n// First sentence. Second sentence.\n// Third sentence.\n//\n// After formatting via `npx prettier --write input.md`:\n// First sentence.\n// Second sentence.\n// Third sentence.","lang":"javascript","description":"Configures Prettier with the plugin and an additional abbreviation, then shows formatting result splitting multi-sentence lines."},"warnings":[{"fix":"Upgrade Prettier to version 3 or later.","message":"Plugin requires Prettier ^3. Prettier 2.x is not supported.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Use dynamic import() or switch to ESM. If using module.require, it will error.","message":"The plugin is ESM-only; CommonJS require('prettier-plugin-sentences-per-line') will fail.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use the exact key name as documented.","message":"Option key must be exactly 'sentencesPerLineAdditionalAbbreviations'. Any other casing or typo will be silently ignored.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Ensure your file extensions are .md or configure Prettier overrides.","message":"The plugin only operates on Markdown files (.md). Other file types are ignored.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install -D prettier-plugin-sentences-per-line` and ensure it's in devDependencies.","cause":"The package is not installed or is not in node_modules.","error":"Error: Cannot find module 'prettier-plugin-sentences-per-line'"},{"fix":"Convert your Prettier config to ESM (use .prettierrc.mjs) or use dynamic import: `module.exports = { plugins: [await import('prettier-plugin-sentences-per-line')] }`","cause":"CommonJS environment (e.g., .prettierrc.cjs with require) importing an ESM-only plugin.","error":"Unexpected token 'export'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}