{"library":"remark-lint-no-multiple-toplevel-headings","title":"remark-lint-no-multiple-toplevel-headings","description":"A remark-lint rule that warns when multiple top-level headings (rank 1) are used in a Markdown document. Current stable version is 4.0.1. This package is part of the remark-lint ecosystem, with releases typically following semantic versioning on a monthly cadence. It differs from other heading‐duplicate checks by focusing specifically on the primary heading level, often used in presets like `remark-preset-lint-markdown-style-guide`. It supports custom depth configuration (1–6) via options. ESM-only, with TypeScript types included. Version 4.x requires remark-lint >=10 and Node >=16.","language":"javascript","status":"active","last_verified":"Fri May 01","install":{"commands":["npm install remark-lint-no-multiple-toplevel-headings"],"cli":null},"imports":["import remarkLintNoMultipleToplevelHeadings from 'remark-lint-no-multiple-toplevel-headings'","import type {Depth} from 'remark-lint-no-multiple-toplevel-headings'","import type {Options} from 'remark-lint-no-multiple-toplevel-headings'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import {unified} from 'unified';\nimport remarkParse from 'remark-parse';\nimport remarkStringify from 'remark-stringify';\nimport remarkLint from 'remark-lint';\nimport remarkLintNoMultipleToplevelHeadings from 'remark-lint-no-multiple-toplevel-headings';\nimport {reporter} from 'vfile-reporter';\n\nconst file = await unified()\n  .use(remarkParse)\n  .use(remarkLint)\n  .use(remarkLintNoMultipleToplevelHeadings, 2) // warn if multiple headings of rank 2\n  .use(remarkStringify)\n  .process('# Hello\\n\\n## World\\n\\n## Again');\n\nconsole.error(reporter(file));\n// Expected: 3:1-3:9: Unexpected duplicate toplevel heading, expected a single heading with rank `2`","lang":"typescript","description":"Shows how to use the rule with unified, linting for duplicate level-2 headings.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}