ESLint plugin for limiting sentences per line in Markdown code. š
npm install eslint-plugin-sentences-per-lineESLint plugin for limiting sentences per line. š
eslint-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.
> š This ESLint plugin assumes you're using @eslint/markdown.
First install this package as a devDependency:
`shell`
npm i -D eslint-plugin-sentences-per-line
Then add the following options to your ESLint configuration file:
`ts
import markdown from "@eslint/markdown";
import sentencesPerLine from "eslint-plugin-sentences-per-line";
export default [
// your other ESLint configurations
{
extends: [
markdown.configs.recommended,
// š Apply this config to your *.md files
sentencesPerLine.configs.recommended,
],
files: ["*/.md"],
},
];
`
š¼ Configurations enabled in.\
ā
Set in the recommended configuration.\--fix
š§ Automatically fixable by the CLI option.
| Name | Description | š¼ | š§ |
| :----------------------- | :----------------------------------------- | :- | :- |
| one | Limits Markdown sentences to one per line. | ā
| š§ |
This package is part of the sentences-per-line family of packages.
You might also consider:
- markdownlint-sentences-per-line: Markdownlint rule to enforce sentences per line in Markdown files.
- prettier-plugin-sentences-per-line`: Prettier plugin to enforce sentences per line in Markdown files.