{"id":26291,"library":"remark-lint","title":"remark-lint","description":"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.","status":"active","version":"10.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/remarkjs/remark-lint#main","tags":["javascript","lint","markdown","mdast","plugin","remark","remark-lint","remark-plugin","unified","typescript"],"install":[{"cmd":"npm install remark-lint","lang":"bash","label":"npm"},{"cmd":"yarn add remark-lint","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-lint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Unified is required to process AST transformations and integrate with remark plugins.","package":"unified","optional":false},{"reason":"Required for parsing Markdown into mdast syntax tree.","package":"remark-parse","optional":false},{"reason":"Required to serialize the mdast syntax tree back to Markdown.","package":"remark-stringify","optional":false},{"reason":"Used to read and write files in Node.js; common in examples.","package":"to-vfile","optional":true},{"reason":"Used to format lint messages as output; common in examples.","package":"vfile-reporter","optional":true}],"imports":[{"note":"Default export; package is ESM-only since v10, so require() will fail. Use import.","wrong":"const remarkLint = require('remark-lint')","symbol":"remarkLint","correct":"import remarkLint from 'remark-lint'"},{"note":"unified is a peer dependency and also ESM-only. Must import it.","wrong":"const unified = require('unified')","symbol":"unified","correct":"import { unified } from 'unified'"},{"note":"remark-parse is ESM-only; no default export in CJS.","wrong":"const remarkParse = require('remark-parse')","symbol":"remarkParse","correct":"import remarkParse from 'remark-parse'"}],"quickstart":{"code":"import remarkLint from 'remark-lint'\nimport remarkParse from 'remark-parse'\nimport remarkStringify from 'remark-stringify'\nimport { read } from 'to-vfile'\nimport { unified } from 'unified'\nimport { reporter } from 'vfile-reporter'\n\nconst file = await read('example.md')\n\nawait unified()\n  .use(remarkParse)\n  .use(remarkLint)\n  .use(remarkStringify)\n  .process(file)\n\nconsole.error(reporter(file))","lang":"typescript","description":"Demonstrates setting up a full unified pipeline to lint a Markdown file using remark-lint, including reading, parsing, linting, stringifying, and reporting warnings."},"warnings":[{"fix":"Use import syntax (ESM) and ensure project is configured for ESM (e.g., type: module in package.json).","message":"Package is ESM-only since version 10.0.0. CommonJS require() will fail.","severity":"breaking","affected_versions":">=10.0.0"},{"fix":"Install a preset like remark-preset-lint-recommended or individual rules such as remark-lint-heading-increment.","message":"This package provides only configuration comment support, not individual lint rules. You must install separate lint rule packages or a preset.","severity":"gotcha","affected_versions":"all"},{"fix":"Update to latest version; use import remarkLint from 'remark-lint'.","message":"Older versions (< 9) required a different import path for the plugin; used to be included in the main remark-lint package but now is separate.","severity":"deprecated","affected_versions":"<9.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Convert to import statement or use dynamic import() inside CJS.","cause":"Using require() to import ESM-only package (remark-lint v10+).","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module not supported"},{"fix":"Use .use(remarkLint) in a unified processor, e.g., unified().use(remarkLint).","cause":"Likely using the package without a unified pipeline; remark-lint expects to be used with .use().","error":"TypeError: remarkLint is not a function"},{"fix":"Run 'npm install remark-lint' and ensure node_modules exists. It has built-in types.","cause":"Package not installed or TypeScript cannot locate typings (should be bundled).","error":"Cannot find module 'remark-lint' or its corresponding type declarations."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}