{"id":26300,"library":"remark-preset-lint-recommended","title":"remark-preset-lint-recommended","description":"A preset for remark-lint that configures a set of recommended rules to catch common problems in markdown files. Current stable version is 7.0.1 (ESM-only, requires Node.js 16+). Part of the unified/remark ecosystem, it bundles 15+ lint rules including checks for final newline, hard break spaces, undefined references, and more. Differentiators: opinionated but minimal set of rules that aim to prevent mistakes and ensure cross-vendor compatibility; ships TypeScript types; actively maintained as part of the remark-lint monorepo.","status":"active","version":"7.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/remarkjs/remark-lint#main","tags":["javascript","preset","recommended","remark","remark-lint","remark-preset","typescript"],"install":[{"cmd":"npm install remark-preset-lint-recommended","lang":"bash","label":"npm"},{"cmd":"yarn add remark-preset-lint-recommended","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-preset-lint-recommended","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core linting engine required to run the preset.","package":"remark-lint","optional":false},{"reason":"Ensures files end with a newline.","package":"remark-lint-final-newline","optional":false},{"reason":"Warns about hard breaks that use too many spaces.","package":"remark-lint-hard-break-spaces","optional":false},{"reason":"Checks bullet indentation in list items.","package":"remark-lint-list-item-bullet-indent","optional":false},{"reason":"Checks list item indentation.","package":"remark-lint-list-item-indent","optional":false},{"reason":"Warns about blockquotes without a marker.","package":"remark-lint-no-blockquote-without-marker","optional":false},{"reason":"Warns about duplicate definition identifiers.","package":"remark-lint-no-duplicate-definitions","optional":false},{"reason":"Warns about indented content in headings.","package":"remark-lint-no-heading-content-indent","optional":false},{"reason":"Warns about bare URLs not wrapped in angle brackets.","package":"remark-lint-no-literal-urls","optional":false},{"reason":"Warns about shortcut reference images.","package":"remark-lint-no-shortcut-reference-image","optional":false},{"reason":"Warns about shortcut reference links.","package":"remark-lint-no-shortcut-reference-link","optional":false},{"reason":"Warns about references without definitions.","package":"remark-lint-no-undefined-references","optional":false},{"reason":"Warns about definitions that are not used.","package":"remark-lint-no-unused-definitions","optional":false},{"reason":"Checks ordered list marker style.","package":"remark-lint-ordered-list-marker-style","optional":false}],"imports":[{"note":"ESM-only since v7; require() throws in Node < 12 or without --experimental-modules.","wrong":"const remarkPresetLintRecommended = require('remark-preset-lint-recommended')","symbol":"remarkPresetLintRecommended","correct":"import remarkPresetLintRecommended from 'remark-preset-lint-recommended'"},{"note":"Package exports a single default export; named import yields undefined.","wrong":"import { remarkPresetLintRecommended } from 'remark-preset-lint-recommended'","symbol":"remarkPresetLintRecommended (default import)","correct":"import remarkPresetLintRecommended from 'remark-preset-lint-recommended'"},{"note":"TypeScript users should import type separately; the preset has no exported types.","wrong":"import remarkPresetLintRecommended from 'remark-preset-lint-recommended' as Preset","symbol":"remarkPresetLintRecommended (type import)","correct":"import type { Preset } from 'unified'; import remarkPresetLintRecommended from 'remark-preset-lint-recommended'"}],"quickstart":{"code":"import remarkParse from 'remark-parse'\nimport remarkPresetLintRecommended from 'remark-preset-lint-recommended'\nimport remarkStringify from 'remark-stringify'\nimport { unified } from 'unified'\nimport { reporter } from 'vfile-reporter'\n\nconst file = await unified()\n  .use(remarkParse)\n  .use(remarkPresetLintRecommended)\n  .use(remarkStringify)\n  .process('# Hello world\\n\\nThis is a test.')\n\nif (file.messages.length > 0) {\n  console.error(reporter(file))\n}\n\nconsole.log(String(file))","lang":"javascript","description":"Shows how to set up and run the recommended lint preset on a Markdown string, reporting any lint issues."},"warnings":[{"fix":"Switch to ESM imports (import) and ensure Node >= 16.","message":"Version 7 drops CommonJS support; package is ESM-only and requires Node.js 16+.","severity":"breaking","affected_versions":">=7.0.0"},{"fix":"If you need to customize a rule, import the specific plugin (e.g., remark-lint-final-newline) and configure it separately.","message":"The preset includes many sub-packaged remark-lint plugins; they are automatically installed but not individually configurable via the preset. To change plugin options, use the individual plugins directly.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Override by importing remark-lint-ordered-list-marker-style with the desired option: .use(remarkLintOrderedListMarkerStyle, ')').","message":"The preset uses remark-lint ordered list marker style with '.' by default. This may conflict with some Markdown style guides that prefer ')'.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use default import: import remarkPresetLintRecommended from 'remark-preset-lint-recommended'. Then use with .use(remarkPresetLintRecommended).","cause":"Incorrect import (named import instead of default) or trying to call the preset as a function without using .use().","error":"TypeError: remarkPresetLintRecommended is not a function"},{"fix":"Install: npm install remark-preset-lint-recommended. If using CommonJS, transpile or update to ESM.","cause":"Package not installed or used in a CommonJS environment with require().","error":"Cannot find module 'remark-preset-lint-recommended'"},{"fix":"Install remark-lint as a direct dependency: npm install remark-lint.","cause":"Missing peer dependency; remark-preset-lint-recommended requires remark-lint to be installed.","error":"Error: Cannot find module 'remark-lint'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}