Registry / testing / remark-lint-no-heading-indent

remark-lint-no-heading-indent

JSON →
library5.0.1jsnpmunverified

A remark-lint rule to warn when Markdown headings are indented. Current stable version is 5.0.1, released as part of the remark-lint monorepo. This package is ESM-only (Node.js 16+). It checks that headings have no leading whitespace, enforcing consistent heading style. Unlike other lint rules, it has no options and is recommended to avoid uncommon indentation that can conflict with indented code blocks. The remark-lint ecosystem provides modular, pluggable linting for Markdown files.

npm install remark-lint-no-heading-indent
INSTALL
IMPORT
SIG · REMARK-LINT-NO-HEA
R
remark-lint-no-heading-indent
testingjavascriptv5.0.1
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.

remarkLintNoHeadingIndent
import remarkLintNoHeadingIndent from 'remark-lint-no-heading-indent'
const remarkLintNoHeadingIndent = require('remark-lint-no-heading-indent')
Package is ESM-only since v5; require() will fail.
default export
import remarkLintNoHeadingIndent from 'remark-lint-no-heading-indent'
import { remarkLintNoHeadingIndent } from 'remark-lint-no-heading-indent'
The package uses a default export, not a named export.
Type types
import type { Transformer } from 'unified'
Package ships TypeScript types (from unified/remark-lint) but no custom types to import.

Set up a unified pipeline with remark-parse, remark-lint, the no-heading-indent rule, and remark-stringify, then process a markdown file and output lint messages.

import remarkLint from 'remark-lint' import remarkLintNoHeadingIndent from 'remark-lint-no-heading-indent' import remarkParse from 'remark-parse' import remarkStringify from 'remark-stringify' import { read } from 'to-vfile' import { unified } from 'unified' import { reporter } from 'vfile-reporter' const file = await read('example.md') await unified() .use(remarkParse) .use(remarkLint) .use(remarkLintNoHeadingIndent) .use(remarkStringify) .process(file) console.error(reporter(file))
Debug
Known issues
breakingPackage is ESM-only starting from v5. CommonJS require() will throw an ERR_REQUIRE_ESM error.
fix
Use import syntax or dynamic import(). For Node.js <16, you cannot use this package; upgrade to Node.js 16+.
affects: >=5.0.0
breakingPeer dependencies (unified, remark-lint) must be installed separately. Missing them causes runtime errors like 'Cannot find module'.
fix
Ensure unified and remark-lint are installed: npm install unified remark-lint remark-lint-no-heading-indent.
affects: >=5.0.0
deprecatedThe package's default export name changed from 'remarkLintNoHeadingIndent' to the same but with a different internal implementation. No API change, but rely on the documented import path.
fix
Update import to current ESM style; old CommonJS usage will break.
affects: >=4.0.0 <5.0.0
gotchaThe rule has no options, but users sometimes try to pass an options object (e.g., { severity: 'warning' }). This will be silently ignored.
fix
Simply use .use(remarkLintNoHeadingIndent) without arguments.
affects: >=5.0.0
Errors
Common errors & fixes
ERR_REQUIRE_ESM
Using require() on an ESM-only package.
fix
Change to import statement: import remarkLintNoHeadingIndent from 'remark-lint-no-heading-indent'
Cannot find module 'unified'
Missing peer dependency 'unified'.
fix
Install unified: npm install unified
TypeError: remarkLintNoHeadingIndent is not a function
Using named import instead of default import (e.g., import { remarkLintNoHeadingIndent } from '...')
fix
Use default import: import remarkLintNoHeadingIndent from 'remark-lint-no-heading-indent'
Upgrade
Version history
5.0.1latest on npm
Audit
Dependencies
unifiedrequiredRequired peer dependency for remark-lint plugins to work with unified processing pipeline.
remark-lintrequiredRequired peer dependency to register the rule and integrate with remark-lint's linting infrastructure.
Agent activity
2 hits · last 30 days
node
2
Resources
remark-lint-no-heading-indent — npm install remark-lint-no-heading-indent · libregistry