{"id":26298,"library":"remark-preset-lint-node","title":"remark-preset-lint-node","description":"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.","status":"active","version":"5.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/nodejs/remark-preset-lint-node","tags":["javascript","remark"],"install":[{"cmd":"npm install remark-preset-lint-node","lang":"bash","label":"npm"},{"cmd":"yarn add remark-preset-lint-node","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-preset-lint-node","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for linting functionality; this preset configures remark-lint rules.","package":"remark-lint","optional":false}],"imports":[{"note":"ESM-only since v5; package has no default export but this preset is a config object.","wrong":"const preset = require('remark-preset-lint-node')","symbol":"preset","correct":"import preset from 'remark-preset-lint-node'"},{"note":"Default export is the preset; named import is not available.","wrong":"import { remarkPresetLintNode } from 'remark-preset-lint-node'","symbol":"remarkPresetLintNode","correct":"import remarkPresetLintNode from 'remark-preset-lint-node'"},{"note":"Sub-preset for recommended settings, only available as named export.","wrong":"export { recommended } from 'remark-preset-lint-node'","symbol":"recommended","correct":"import { recommended } from 'remark-preset-lint-node'"}],"quickstart":{"code":"import { unified } from 'unified';\nimport remarkParse from 'remark-parse';\nimport remarkStringify from 'remark-stringify';\nimport remarkPresetLintNode from 'remark-preset-lint-node';\nimport remarkLint from 'remark-lint';\n\nconst file = await unified()\n  .use(remarkParse)\n  .use(remarkLint)\n  .use(remarkPresetLintNode)\n  .use(remarkStringify)\n  .process('# Hello\\n\\nSome text.');\n\nconsole.log(file.messages);","lang":"javascript","description":"Set up remark-lint with the node preset and process a markdown file."},"warnings":[{"fix":"Switch to ESM imports and ensure Node.js >=18.0.0.","message":"v5.0.0 dropped CommonJS support; package is now ESM-only.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Update documentation to adhere to 120 characters per line, or override the rule.","message":"Maximum line length changed from 80 to 120 in v5.0.1.","severity":"breaking","affected_versions":">=5.0.1"},{"fix":"Upgrade to latest remark-lint and remark-preset-lint-node.","message":"The 'nodejs-yaml-comments' rule may not work with older versions of remark-lint.","severity":"deprecated","affected_versions":"<5.0.0"},{"fix":"Set NODE_RELEASED_VERSIONS as a comma-separated list of version strings.","message":"Environment variable NODE_RELEASED_VERSIONS must be set for full version validation; otherwise some checks are skipped.","severity":"gotcha","affected_versions":">=4.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use ESM import or ensure package is installed and project is configured for ESM.","cause":"Attempting to require() the package in a CommonJS context.","error":"Error: Cannot find module 'remark-preset-lint-node'"},{"fix":"Use import preset from 'remark-preset-lint-node' instead of { preset }.","cause":"Incorrect import: using named import when package only has default export.","error":"TypeError: Preset must be an object or function"},{"fix":"Install and configure remark-lint correctly.","cause":"Missing remark-lint or too old version that does not include the rule.","error":"Warning: Rule 'maximum-line-length' not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}