eslint-plugin-sentences-per-line
v0.1.0
Published
ESLint plugin for limiting sentences per line in Markdown code. ๐
Readme
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
- First sentence. Second sentence.
+ First sentence.
+ Second sentence.Usage
๐ This ESLint plugin assumes you're using
@eslint/markdown.
First install this package as a devDependency:
npm i -D eslint-plugin-sentences-per-lineThen add the following options to your ESLint configuration file:
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"],
},
];Rules
๐ผ Configurations enabled in.
โ
Set in the recommended configuration.
๐ง Automatically fixable by the --fix CLI option.
| Name | Description | ๐ผ | ๐ง | | :----------------------- | :----------------------------------------- | :- | :- | | one | Limits Markdown sentences to one per line. | โ | ๐ง |
Alternatives
This package is part of the sentences-per-line of packages. You might also consider:
markdownlint-sentences-per-line: Markdownlint rule to enforce sentences per line in Markdown files.
