Registry / testing / remark-preset-lint-consistent

remark-preset-lint-consistent

JSON →
library6.0.1jsnpmunverified

remark preset that configures remark-lint rules to enforce consistency in Markdown style, such as blockquote indentation, emphasis marker, heading style, list marker style, and table cell padding. Current stable version is 6.0.1. Part of the remark-lint monorepo, released on npm with ESM-only support since v4. Key differentiator: it provides a zero-config preset for consistent Markdown formatting, complementing other presets like remark-preset-lint-recommended and remark-preset-lint-markdown-style-guide. Actively maintained by the unified collective.

npm install remark-preset-lint-consistent
INSTALL
IMPORT
SIG · REMARK-PRESET-LINT
R
remark-preset-lint-consistent
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.

remarkPresetLintConsistent
import remarkPresetLintConsistent from 'remark-preset-lint-consistent'
const remarkPresetLintConsistent = require('remark-preset-lint-consistent')
ESM-only since v4; CommonJS require() throws ERR_REQUIRE_ESM.
default
import remarkPresetLintConsistent from 'remark-preset-lint-consistent'
import { remarkPresetLintConsistent } from 'remark-preset-lint-consistent'
This package has a default export only, not a named export.
type remarkPresetLintConsistent
import type { default as remarkPresetLintConsistent } from 'remark-preset-lint-consistent'
import { remarkPresetLintConsistent } from 'remark-preset-lint-consistent'
TypeScript users should use the default export type via `typeof import('remark-preset-lint-consistent')` or use a type assertion.

Process a Markdown file with the preset to check for consistency issues and report them.

import { unified } from 'unified'; import remarkParse from 'remark-parse'; import remarkStringify from 'remark-stringify'; import remarkPresetLintConsistent from 'remark-preset-lint-consistent'; import { reporter } from 'vfile-reporter'; import { read } from 'to-vfile'; const file = await read('example.md'); await unified() .use(remarkParse) .use(remarkPresetLintConsistent) .use(remarkStringify) .process(file); console.error(reporter(file)); // If there are consistency issues, they will be reported.
Debug
Known issues
breakingremark-preset-lint-consistent v4 dropped support for CommonJS (require). Packages are now ESM-only.
fix
Switch to ESM imports and ensure Node.js version >=16.
affects: >=4.0.0
gotchaThe preset uses 'consistent' as the default option for most rules, which may not match your project's current style. It warns about inconsistencies, not a specific style.
fix
To enforce a specific style, use individual remark-lint rules with explicit options instead of the preset.
affects: *
deprecatedSome underlying rules like remark-lint-table-cell-padding will be updated in future versions; check compatibility when upgrading.
fix
Always pin exact versions of remark-lint packages to avoid unexpected warnings.
affects: *
gotchaThe preset requires remark-lint to be installed as a peer dependency, but it is not automatically installed. Missing peerDependency can cause runtime errors.
fix
Ensure remark-lint is in your dependencies: npm install remark-lint
affects: *
breakingIn v5, the internal structure changed: all rules now export a function that must be used with unified().use(). If you were passing options in a different way, it may break.
fix
Use the preset as a unified plugin: .use(remarkPresetLintConsistent) without additional configuration.
affects: >=5.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/remark-preset-lint-consistent/index.js from /path/to/your-file.js not supported.
Using CommonJS require() with an ESM-only package (v4+).
fix
Convert your project to ESM (add 'type': 'module' to package.json) or use dynamic import: const m = await import('remark-preset-lint-consistent');
TypeError: remarkPresetLintConsistent is not a function
Importing the preset incorrectly (e.g., using named import) or forgetting to add it to unified().use().
fix
Use default import: import remarkPresetLintConsistent from 'remark-preset-lint-consistent'; then .use(remarkPresetLintConsistent)
Missing required peer dependency: remark-lint
remark-lint is not installed.
fix
Run: npm install remark-lint
Upgrade
Version history
6.0.1latest on npm
Audit
Dependencies
remark-lintrequiredBase linting engine
unifiedrequiredRequired to process Markdown with remark plugins
Agent activity
4 hits · last 30 days
node
4
Resources
remark-preset-lint-consistent — npm install remark-preset-lint-consistent · libregistry