{"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,"search_vec":"'120':61 '5.1.2':28 'align':33 'cadenc':32 'charact':62 'combin':67 'comment':45 'convent':55 'current':24 'custom':41 'differenti':39 'document':22,36 'enforc':52 'environ':49 'file':12 'includ':40 'javascript':79 'key':38 'length':59 'like':56 'line':58 'lint':4,10,71 'markdown':11 'maximum':57 'node':5 'node.js':15,21,35,53,77 'part':74 'preset':3,8,63 'project':54 'releas':29 'remark':2,7,70,80 'remark-lint':69 'remark-preset-lint-nod':1 'repositori':16 'rule':19,42 'specif':18 'stabl':25 'style':23 'toolchain':78 'updat':37 'use':65 'valid':47 'variabl':50 'version':26,46 'via':48 'yaml':44","created_at":"2026-05-01T13:49:15.371493+00:00","updated_at":"2026-05-01T13:49:15.371493+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"remark","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/nodejs/remark-preset-lint-node","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/remark-preset-lint-node","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}