Use Unified, Remark, and Retext plugins to lint Markdown.
Plugins are available to:
- Check spelling
- Check readability
- Avoid repeated words
- Avoid profanity
- Avoid passive words / phrases
Use Prettier and the Prettier VS Code extension for format Markdown.
This extension requires packages to be installed locally, and a .remarkrc.js
(or similar) configuration file in same folder hierarchy as the .md
Markdown files that will be linted.
Install packages:
npm install --save unified remark-frontmatter remark-retext retext-english retext-syntax-urls retext-spell dictionary-en-us retext-sentence-spacing retext-repeated-words retext-usage remark-preset-lint-consistent remark-preset-lint-recommended remark-preset-lint-markdown-style-guide
Create an .remarkrc.js
with settings and plugins:
// .remarkrc.js
exports.plugins = [
require('remark-frontmatter'),
[
require('remark-retext'),
require('unified')().use({
plugins: [
require('retext-english'),
require('retext-syntax-urls'),
[require('retext-spell'), require('dictionary-en-us')],
[require('retext-sentence-spacing'), { preferred: 1 }],
require('retext-repeated-words'),
require('retext-usage'),
],
}),
],
require('remark-preset-lint-consistent'),
require('remark-preset-lint-recommended'),
require('remark-preset-lint-markdown-style-guide'),
];
- First Release
MIT