prettier-plugin-sentences-per-line
v0.2.5
Published
Prettier plugin for limiting sentences per line. ๐
Readme
prettier-plugin-sentences-per-line allows you to enforce that no line in your Markdown files contains more than one sentence.
This is useful because:
- Shorter lines result in simpler, easier-to-understand Git diffs
- Longer lines are harder to read in source code
- First sentence. Second sentence.
+ First sentence.
+ Second sentence.Usage
First install this package as a devDependency:
npm i -D prettier-plugin-sentences-per-lineThen add it to your Prettier config's plugins:
{
"plugins": ["prettier-plugin-sentences-per-line"]
}Sentences within Markdown table rows are left alone, as splitting a row across lines would break the table.
Options
sentencesPerLineAdditionalAbbreviations
An array of custom abbreviations to ignore when determining sentence boundaries.
These will be added to the standard list of abbreviations below.
["eg.", "e.g.", "etc.", "ex.", "ie.", "i.e.", "vs."]
{
"plugins": ["prettier-plugin-sentences-per-line"],
"sentencesPerLineAdditionalAbbreviations": ["I.M."]
}Alternatives
This package is part of the sentences-per-line family of packages.
You might also consider:
eslint-plugin-sentences-per-line: ESLint plugin to enforce sentences per line in Markdown files.markdownlint-sentences-per-line: Markdownlint plugin to enforce sentences per line in Markdown files.
