remark-preset-lint-styleguide

raw JSON →
1.0.0 verified Fri May 01 auth: no javascript

remark preset to configure remark-lint with rules inspired by popular Markdown style guides, including Markdown Style Guide, Google documentation guide, and CommonMark specification. Current version: 1.0.0 (Node >=4). Integrates all official remark-lint rules and exposes multiple presets: default, writability, readability. Use with remark-cli or programmatically. Differentiators: opinionated but customizable, supports external rules and configuration comments, suited for maintaining portable Markdown.

error Error: Cannot find module 'remark-preset-lint-styleguide/writability'
cause Missing package name prefix or incorrect path
fix
Use require('remark-preset-lint-styleguide/writability') (note the full package name).
error SyntaxError: Unexpected identifier (when using import)
cause Package is CJS-only; import not supported
fix
Use require() instead of import.
error Error: Configuration for 'remark-preset-lint-styleguide' not found
cause Plugin not installed or missing dependency
fix
Run 'npm install remark-preset-lint-styleguide' and ensure it's listed in remarkConfig.
gotcha Presets must be imported with full package name prefix (e.g., 'remark-preset-lint-styleguide/writability'). Omitting prefix leads to module not found.
fix Use require('remark-preset-lint-styleguide/PRESET_NAME') instead of just 'PRESET_NAME'.
gotcha Package is CJS-only; does not provide ESM exports. Using 'import' will fail.
fix Use require() instead of import.
deprecated Node.js >=4 required; older versions may cause runtime errors.
fix Update Node.js to >=4 or ideally latest LTS.
npm install remark-preset-lint-styleguide
yarn add remark-preset-lint-styleguide
pnpm add remark-preset-lint-styleguide

Programmatic usage: read a Markdown file, lint with default preset, and output formatted report.

const fs = require('fs');
const remark = require('remark');
const styleguide = require('remark-preset-lint-styleguide');
const report = require('vfile-reporter');

const myFile = fs.readFileSync('my-awesome-article.md', 'utf8');
let output = remark().use(styleguide).processSync(myFile);
console.log(report(output));