Prettier plugin for limiting sentences per line. 📐
npm install prettier-plugin-sentences-per-linePrettier plugin for limiting sentences per line. 📐
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
``diff`
- First sentence. Second sentence.
+ First sentence.
+ Second sentence.
First install this package as a devDependency:
`shell`
npm i -D prettier-plugin-sentences-per-line
Then add it to your Prettier config's plugins:
`json`
{
"plugins": ["prettier-plugin-sentences-per-line"]
}
#### 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."]
`json`
{
"plugins": ["prettier-plugin-sentences-per-line"],
"sentencesPerLineAdditionalAbbreviations": ["I.M."]
}
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.