Registry / testing / remark-lint-heading-whitespace

remark-lint-heading-whitespace

JSON →
library1.0.0jsnpmunverified

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.

npm install remark-lint-heading-whitespace
INSTALL
IMPORT
SIG · REMARK-LINT-HEADIN
R
remark-lint-heading-whitespace
testingjavascriptv1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import remarkLintHeadingWhitespace from 'remark-lint-heading-whitespace'
const remarkLintHeadingWhitespace = require('remark-lint-heading-whitespace')
ESM-only package; does not provide a CommonJS export. Use dynamic import or ensure Node.js >= 12 with 'type':'module'.
remarkLintHeadingWhitespace
import remarkLintHeadingWhitespace from 'remark-lint-heading-whitespace'
import { remarkLintHeadingWhitespace } from 'remark-lint-heading-whitespace'
The package exports a single default function; named import does not exist.

Shows how to use the rule with remark, processing a heading containing a non-breaking space and outputting lint warnings.

import { remark } from 'remark'; import lint from 'remark-lint'; import remarkLintHeadingWhitespace from 'remark-lint-heading-whitespace'; const file = await remark() .use(lint) .use(remarkLintHeadingWhitespace) .process('#\u00A0bad heading'); console.log(String(file)); // includes warning about non-breaking space
Debug
Known issues
gotchaPackage is ESM-only. Using CommonJS require() will fail with ERR_REQUIRE_ESM.
fix
Use dynamic import() or set 'type':'module' in package.json.
affects: >=1.0.0
gotchaThe rule does not automatically apply; it must be added as a plugin to remark with .use(lint) and .use(remarkLintHeadingWhitespace).
fix
Ensure both remark-lint and this rule are included in the remark pipeline.
affects: >=1.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
Attempting to require() the ESM-only package in a CommonJS context.
fix
Use import() or set 'type':'module' in package.json.
TypeError: remarkLintHeadingWhitespace is not a function
Named import used instead of default import.
fix
Use `import remarkLintHeadingWhitespace from 'remark-lint-heading-whitespace'` (default import).
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
remark-lintrequiredRequired peer dependency to define the lint rule interface
Agent activity
4 hits · last 30 days
node
4
Resources
remark-lint-heading-whitespace — npm install remark-lint-heading-whitespace · libregistry