Registry / testing / remark-preset-lint-node

remark-preset-lint-node

JSON →
library5.1.2jsnpmunverified

A remark preset for linting Markdown files in the Node.js repository with specific rules for Node.js documentation style. Current stable version is 5.1.2. Released on a cadence aligned with Node.js documentation updates. Key differentiators: includes custom rules for YAML comments, version validation via environment variables, and enforces Node.js project conventions like maximum line length of 120 characters. Preset is used in combination with remark-lint and is part of the Node.js toolchain.

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

preset
✓ import preset from 'remark-preset-lint-node'
✗ const preset = require('remark-preset-lint-node')
ESM-only since v5; package has no default export but this preset is a config object.
remarkPresetLintNode
✓ import remarkPresetLintNode from 'remark-preset-lint-node'
✗ import { remarkPresetLintNode } from 'remark-preset-lint-node'
Default export is the preset; named import is not available.
recommended
✓ import { recommended } from 'remark-preset-lint-node'
✗ export { recommended } from 'remark-preset-lint-node'
Sub-preset for recommended settings, only available as named export.

Set up remark-lint with the node preset and process a markdown file.

import { unified } from 'unified'; import remarkParse from 'remark-parse'; import remarkStringify from 'remark-stringify'; import remarkPresetLintNode from 'remark-preset-lint-node'; import remarkLint from 'remark-lint'; const file = await unified() .use(remarkParse) .use(remarkLint) .use(remarkPresetLintNode) .use(remarkStringify) .process('# Hello\n\nSome text.'); console.log(file.messages);
remark --version
Debug
Known issues
breakingv5.0.0 dropped CommonJS support; package is now ESM-only.
fix
Switch to ESM imports and ensure Node.js >=18.0.0.
affects: >=5.0.0
breakingMaximum line length changed from 80 to 120 in v5.0.1.
fix
Update documentation to adhere to 120 characters per line, or override the rule.
affects: >=5.0.1
deprecatedThe 'nodejs-yaml-comments' rule may not work with older versions of remark-lint.
fix
Upgrade to latest remark-lint and remark-preset-lint-node.
affects: <5.0.0
gotchaEnvironment variable NODE_RELEASED_VERSIONS must be set for full version validation; otherwise some checks are skipped.
fix
Set NODE_RELEASED_VERSIONS as a comma-separated list of version strings.
affects: >=4.0.0
Errors
Common errors & fixes
Error: Cannot find module 'remark-preset-lint-node'
Attempting to require() the package in a CommonJS context.
fix
Use ESM import or ensure package is installed and project is configured for ESM.
TypeError: Preset must be an object or function
Incorrect import: using named import when package only has default export.
fix
Use import preset from 'remark-preset-lint-node' instead of { preset }.
Warning: Rule 'maximum-line-length' not found
Missing remark-lint or too old version that does not include the rule.
fix
Install and configure remark-lint correctly.
Upgrade
Version history
5.1.2latest on npm
Audit
Dependencies
remark-lintrequiredRequired for linting functionality; this preset configures remark-lint rules.
Agent activity
4 hits · last 30 days
node
4
Resources
remark-preset-lint-node — npm install remark-preset-lint-node · libregistry