{"id":26217,"library":"remark-lint-heading-length","title":"remark-lint-heading-length","description":"A remark-lint rule to enforce a minimum and maximum number of words in headings in Markdown files. Version 1.0.0 is the current stable release, based on the unified ecosystem. It allows configuration of min and max word counts, with defaults of 2 and 10 respectively. Unlike generic linters, this rule is specific to heading length and integrates seamlessly with remark-lint presets.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install remark-lint-heading-length","lang":"bash","label":"npm"},{"cmd":"yarn add remark-lint-heading-length","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-lint-heading-length","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core linting framework required for rule registration and execution","package":"remark-lint","optional":false},{"reason":"Underlying processor for parsing and transforming Markdown","package":"unified","optional":false}],"imports":[{"note":"Default export; ESM-only since v1. CommonJS require cannot destructure.","wrong":"const { remarkLintHeadingLength } = require('remark-lint-heading-length')","symbol":"remarkLintHeadingLength","correct":"import remarkLintHeadingLength from 'remark-lint-heading-length'"},{"note":"Named default import works but is unnecessary; use default import directly.","wrong":"import { default as remarkLintHeadingLength } from 'remark-lint-heading-length'","symbol":"default","correct":"import remarkLintHeadingLength from 'remark-lint-heading-length'"},{"note":"remark-lint is a preset; use named export for the plugin function.","wrong":"import remarkLint from 'remark-lint'","symbol":"remarkLint","correct":"import { remarkLint } from 'remark-lint'"}],"quickstart":{"code":"import { remark } from 'remark';\nimport remarkLint from 'remark-lint';\nimport remarkLintHeadingLength from 'remark-lint-heading-length';\n\nconst file = await remark()\n  .use(remarkLint)\n  .use(remarkLintHeadingLength, ['error', { min: 3, max: 12 }])\n  .process('# Too short');\n\nconsole.log(file.messages); // Message: Heading must have at least 3 words","lang":"javascript","description":"Configures remark-lint with the heading-length rule, then processes a Markdown string to show linting output."},"warnings":[{"fix":"Use array format: [severity, options] or just severity string.","message":"Configuration must be an array with severity and options; passing plain object fails silently.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Configure min to 1 if single-word headings are acceptable.","message":"Default min/max may not suit all projects; headings like 'Introduction' (1 word) will trigger warnings.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use eslint-plugin-markdown or unified-based linters instead.","message":"This package is part of the deprecated remark-lint v8 line; consider migrating to unified and eslint-plugin-markdown.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run: npm install remark-lint-heading-length","cause":"Package not installed or missing from dependencies.","error":"Error: Cannot find module 'remark-lint-heading-length'"},{"fix":"Use default import: import remarkLintHeadingLength from 'remark-lint-heading-length'","cause":"Importing the package incorrectly (e.g., destructuring a non-default export).","error":"TypeError: plugin is not a function"},{"fix":"Use array format: ['error', { min: 2, max: 10 }]","cause":"Passing configuration as a plain object instead of array.","error":"Error: Illegal configuration for remark-lint-heading-length"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}