Registry / testing / remark-lint

remark-lint

JSON →
library10.0.1jsnpmunverified

remark-lint is a modular linting system for Markdown files, built on the unified ecosystem. It provides a plugin for remark that enables configuration comments to selectively enable/disable rules inline. This package is part of the remark-lint monorepo (v10.0.1) which includes 60+ individual lint rules and presets like `remark-preset-lint-recommended`. It requires Node.js 16+ and is ESM-only. Released under MIT license by Titus Wormer. Unlike other Markdown linters (e.g., markdownlint), it integrates directly with the unified processor pipeline, making it extensible and composable.

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

remarkLint
import remarkLint from 'remark-lint'
const remarkLint = require('remark-lint')
Default export; package is ESM-only since v10, so require() will fail. Use import.
unified
import { unified } from 'unified'
const unified = require('unified')
unified is a peer dependency and also ESM-only. Must import it.
remarkParse
import remarkParse from 'remark-parse'
const remarkParse = require('remark-parse')
remark-parse is ESM-only; no default export in CJS.

Demonstrates setting up a full unified pipeline to lint a Markdown file using remark-lint, including reading, parsing, linting, stringifying, and reporting warnings.

import remarkLint from 'remark-lint' import remarkParse from 'remark-parse' import remarkStringify from 'remark-stringify' import { read } from 'to-vfile' import { unified } from 'unified' import { reporter } from 'vfile-reporter' const file = await read('example.md') await unified() .use(remarkParse) .use(remarkLint) .use(remarkStringify) .process(file) console.error(reporter(file))
Debug
Known issues
breakingPackage is ESM-only since version 10.0.0. CommonJS require() will fail.
fix
Use import syntax (ESM) and ensure project is configured for ESM (e.g., type: module in package.json).
affects: >=10.0.0
gotchaThis package provides only configuration comment support, not individual lint rules. You must install separate lint rule packages or a preset.
fix
Install a preset like remark-preset-lint-recommended or individual rules such as remark-lint-heading-increment.
affects: all
deprecatedOlder versions (< 9) required a different import path for the plugin; used to be included in the main remark-lint package but now is separate.
fix
Update to latest version; use import remarkLint from 'remark-lint'.
affects: <9.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
Using require() to import ESM-only package (remark-lint v10+).
fix
Convert to import statement or use dynamic import() inside CJS.
TypeError: remarkLint is not a function
Likely using the package without a unified pipeline; remark-lint expects to be used with .use().
fix
Use .use(remarkLint) in a unified processor, e.g., unified().use(remarkLint).
Cannot find module 'remark-lint' or its corresponding type declarations.
Package not installed or TypeScript cannot locate typings (should be bundled).
fix
Run 'npm install remark-lint' and ensure node_modules exists. It has built-in types.
Upgrade
Version history
10.0.1latest on npm
Audit
Dependencies
unifiedrequiredUnified is required to process AST transformations and integrate with remark plugins.
remark-parserequiredRequired for parsing Markdown into mdast syntax tree.
remark-stringifyrequiredRequired to serialize the mdast syntax tree back to Markdown.
to-vfileoptionalUsed to read and write files in Node.js; common in examples.
vfile-reporteroptionalUsed to format lint messages as output; common in examples.
Agent activity
4 hits · last 30 days
node
4
Resources
remark-lint — npm install remark-lint · libregistry