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.
npm install remark-lint-no-multiple-toplevel-headingsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to use the rule with unified, linting for duplicate level-2 headings.
Use import syntax or switch to dynamic import(). For CommonJS projects, consider using remark-lint-no-multiple-toplevel-headings@3 (last CJS version).
Update call from `.use(rule, {depth: 1})` to `.use(rule, 1)`. If using previous object form, it is silently ignored in v4 (produces no linting).Upgrade remark-lint to >=10. Run `npm install remark-lint@latest`.
Use `.use(remarkLintNoMultipleToplevelHeadings, 2)` for level-2 headings, etc. Or use a different rule (e.g., `remark-lint-no-duplicate-headings`) for hierarchical duplicates.
Pass the depth number directly: `.use(remarkLintNoMultipleToplevelHeadings, 1)`.
Use `import remarkLintNoMultipleToplevelHeadings from 'remark-lint-no-multiple-toplevel-headings'` in an ESM context, or downgrade to v3 with `npm install remark-lint-no-multiple-toplevel-headings@3`.
Use the import statement as shown in the documentation: `import remarkLintNoMultipleToplevelHeadings from 'remark-lint-no-multiple-toplevel-headings'`.
Add `.use(remarkLint)` before `.use(remarkLintNoMultipleToplevelHeadings)` in the unified chain.
Change the extra top-level headings to a lower rank (e.g., `##`), or configure a different depth via options.