{"id":26223,"library":"remark-lint-heading-whitespace","title":"remark-lint-heading-whitespace","description":"remark-lint rule that detects non-breaking spaces (U+00A0) inserted accidentally after heading markers (e.g., '# ' instead of '# '), which causes headings to be parsed as plain paragraphs. Version 1.0.0 (latest) is stable and targets the remark-lint plugin ecosystem. No known release cadence. Differentiates from other lint rules by focusing on a specific, localization-driven typo that is common on keyboard layouts like Swiss German where '#' is typed via Alt+3 and Alt+Space produces a non-breaking space. Integrates as a remark-lint plugin.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/vhf/remark-lint-heading-whitespace","tags":["javascript"],"install":[{"cmd":"npm install remark-lint-heading-whitespace","lang":"bash","label":"npm"},{"cmd":"yarn add remark-lint-heading-whitespace","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-lint-heading-whitespace","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required peer dependency to define the lint rule interface","package":"remark-lint","optional":false}],"imports":[{"note":"ESM-only package; does not provide a CommonJS export. Use dynamic import or ensure Node.js >= 12 with 'type':'module'.","wrong":"const remarkLintHeadingWhitespace = require('remark-lint-heading-whitespace')","symbol":"default","correct":"import remarkLintHeadingWhitespace from 'remark-lint-heading-whitespace'"},{"note":"The package exports a single default function; named import does not exist.","wrong":"import { remarkLintHeadingWhitespace } from 'remark-lint-heading-whitespace'","symbol":"remarkLintHeadingWhitespace","correct":"import remarkLintHeadingWhitespace from 'remark-lint-heading-whitespace'"}],"quickstart":{"code":"import { remark } from 'remark';\nimport lint from 'remark-lint';\nimport remarkLintHeadingWhitespace from 'remark-lint-heading-whitespace';\n\nconst file = await remark()\n  .use(lint)\n  .use(remarkLintHeadingWhitespace)\n  .process('#\\u00A0bad heading');\n\nconsole.log(String(file)); // includes warning about non-breaking space","lang":"typescript","description":"Shows how to use the rule with remark, processing a heading containing a non-breaking space and outputting lint warnings."},"warnings":[{"fix":"Use dynamic import() or set 'type':'module' in package.json.","message":"Package is ESM-only. Using CommonJS require() will fail with ERR_REQUIRE_ESM.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure both remark-lint and this rule are included in the remark pipeline.","message":"The rule does not automatically apply; it must be added as a plugin to remark with .use(lint) and .use(remarkLintHeadingWhitespace).","severity":"gotcha","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":"Use import() or set 'type':'module' in package.json.","cause":"Attempting to require() the ESM-only package in a CommonJS context.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module not supported"},{"fix":"Use `import remarkLintHeadingWhitespace from 'remark-lint-heading-whitespace'` (default import).","cause":"Named import used instead of default import.","error":"TypeError: remarkLintHeadingWhitespace is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}