{"id":26220,"library":"remark-lint-heading-word-length","title":"remark-lint-heading-word-length","description":"A remark-lint rule that warns when headings contain too many or too few words. Version 3.0.0 is current; breaking change drops Node <20.18.0. Words are split on whitespace. Unlike the archived remark-lint-heading-length, this rule supports configurable min/max word counts. ESM-only. Part of the unified-utils monorepo with semantic-release.","status":"active","version":"3.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/Xunnamius/unified-utils","tags":["javascript","remark","remark-plugin","plugin","markdown","remark-lint","lint","rule","remark-lint-rule"],"install":[{"cmd":"npm install remark-lint-heading-word-length","lang":"bash","label":"npm"},{"cmd":"yarn add remark-lint-heading-word-length","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-lint-heading-word-length","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Provides the lint rule base class and message API.","package":"unified-lint-rule","optional":false}],"imports":[{"note":"ESM-only package; CommonJS require() will throw MODULE_NOT_FOUND.","wrong":"const lintHeadingWordLength = require('remark-lint-heading-word-length')","symbol":"lintHeadingWordLength","correct":"import lintHeadingWordLength from 'remark-lint-heading-word-length'"},{"note":"The package exports a single default function, not a named export.","wrong":"import { lintHeadingWordLength } from 'remark-lint-heading-word-length'","symbol":"default import","correct":"import lintHeadingWordLength from 'remark-lint-heading-word-length'"},{"note":"In .remarkrc or package.json plugins array, use the short name without 'remark-lint-'. This matches the plugin's `remarkLint` convention.","wrong":"\"remark-lint-heading-word-length\"","symbol":"plugin name in config","correct":"\"lint-heading-word-length\""}],"quickstart":{"code":"import { read } from 'to-vfile';\nimport { reporter } from 'vfile-reporter';\nimport { remark } from 'remark';\nimport remarkLint from 'remark-lint';\nimport lintHeadingWordLength from 'remark-lint-heading-word-length';\n\nconst file = await remark()\n  .use(remarkLint)\n  .use(lintHeadingWordLength, { minimumWords: 3, maximumWords: 12 })\n  .process(await read('example.md'));\n\nconsole.log(reporter(file));","lang":"typescript","description":"Loads a markdown file, lints headings for word count, and prints errors using vfile-reporter."},"warnings":[{"fix":"Upgrade Node to 20.18.0 or later.","message":"Minimum Node version now 20.18.0","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Switch from require() to import. If you must use CommonJS, consider dynamic import() or stick with v2.x.","message":"Package is now ESM-only","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Migrate to remark-lint-heading-word-length for active development and new features.","message":"The old 'remark-lint-heading-length' package is archived and no longer maintained","severity":"deprecated","affected_versions":"all"},{"fix":"Use 'lint-heading-word-length' in .remarkrc or package.json plugins array.","message":"Plugin short name 'lint-heading-word-length' must be used in config (not full package name)","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Replace 'const ... = require(...)' with 'import ... from ...'","cause":"Attempting to use CommonJS require() on ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module"},{"fix":"Use 'lint-heading-word-length' instead of 'remark-lint-heading-word-length'.","cause":"Using the full npm package name as plugin key in remark config.","error":"TypeError: plugin is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}