Registry / testing / remark-preset-lint-markdown-style-guide

remark-preset-lint-markdown-style-guide

JSON →
library6.0.1jsnpmunverified

Remark preset that configures remark-lint rules to enforce the Markdown Style Guide. Version 6.0.1 ships TypeScript types and is actively maintained as part of the remark-lint monorepo. It includes 30+ lint rules with sensible defaults like fenced code blocks, ATX headings, and hyphen unordered list markers. Unlike generic presets, this one maps directly to an existing style guide and supports overrides for space-sentence, wrap, header, list-marker, list-space, and code options. Release cadence is patch-level; breaking changes are rare and documented in changelogs.

npm install remark-preset-lint-markdown-style-guide
INSTALL
IMPORT
SIG · REMARK-PRESET-LINT
R
remark-preset-lint-markdown-style-guide
testingjavascriptv6.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

remarkPresetLintMarkdownStyleGuide
import remarkPresetLintMarkdownStyleGuide from 'remark-preset-lint-markdown-style-guide'
const remarkPresetLintMarkdownStyleGuide = require('remark-preset-lint-markdown-style-guide')
ESM-only since v6. Use dynamic import or switch to ESM.
remarkPresetLintMarkdownStyleGuide
import remarkPresetLintMarkdownStyleGuide from 'remark-preset-lint-markdown-style-guide'
import { remarkPresetLintMarkdownStyleGuide } from 'remark-preset-lint-markdown-style-guide'
This preset exports a default, not a named export. Named import will result in undefined.
type Options
import type { Options } from 'remark-preset-lint-markdown-style-guide'
import { Options } from 'remark-preset-lint-markdown-style-guide'
Options type is only available as a type export. Use type import to avoid runtime errors.

Shows how to set up a unified pipeline with remark-lint and the markdown style guide preset, then lint a simple markdown string.

import { unified } from 'unified'; import remarkParse from 'remark-parse'; import remarkPresetLintMarkdownStyleGuide from 'remark-preset-lint-markdown-style-guide'; import remarkStringify from 'remark-stringify'; import remarkLint from 'remark-lint'; const processor = unified() .use(remarkParse) .use(remarkLint) .use(remarkPresetLintMarkdownStyleGuide) .use(remarkStringify); const file = await processor.process('## Hello world'); console.log(file.messages); // lint warnings/errors
Debug
Known issues
breakingv6.0.0 dropped CommonJS support. Package is now ESM-only.
fix
Migrate to ESM or use dynamic import: const pkg = await import('remark-preset-lint-markdown-style-guide')
affects: <6.0.0
deprecatedThe option 'header:setext' uses a deprecated method; prefer ATX headings.
fix
Override 'remark-lint-heading-style' option to 'setext' via preset configuration.
affects: >=6.0.0
breakingv5.0.0 renamed the presets from 'remark-preset-lint-markdown-style-guide' to 'remark-preset-lint-markdown-style-guide' (no change) but removed support for Node < 12.
fix
Update Node.js to version 12 or later.
affects: <5.0.0
gotchaThe preset includes remark-lint automatically; adding it twice causes duplicate linting.
fix
Do not include 'remark-lint' separately unless you need custom options.
affects: >=4.0.0
gotchaOptions like 'wrap:no', 'header:setext', etc. must be configured via overriding individual lint rules, not by passing options to the preset.
fix
Follow the README's override patterns: e.g., use ['remark-lint-maximum-line-length', false] to disable line length.
affects: >=6.0.0
Errors
Common errors & fixes
Cannot find module 'remark-preset-lint-markdown-style-guide'
Missing installation or wrong import path in a CommonJS project.
fix
npm install remark-preset-lint-markdown-style-guide and ensure your project is ESM or use dynamic import.
TypeError: remarkPresetLintMarkdownStyleGuide is not a function
Using named import instead of default import.
fix
Change to: import remarkPresetLintMarkdownStyleGuide from 'remark-preset-lint-markdown-style-guide'
Error: Cannot use import statement outside a module
Attempting to use ESM import in a CommonJS file.
fix
Set type: 'module' in package.json or rename file to .mjs.
The option 'remark-lint-maximum-line-length' is not a boolean
Passing a boolean false to disable a rule, but the preset expects an object or array.
fix
Correct syntax: ['remark-lint-maximum-line-length', false] (array of two elements)
Upgrade
Version history
6.0.1latest on npm
Audit
Dependencies
remark-lintrequiredCore linting engine required to run the preset
Agent activity
6 hits · last 30 days
node
6
Resources
remark-preset-lint-markdown-style-guide — npm install remark-preset-lint-markdown-style-guide · libregistry