remark-lint-no-heading-like-paragraph
raw JSON → 4.0.1 verified Fri May 01 auth: no javascript
A remark-lint rule that warns when a markdown paragraph starts with too many hash characters (#), making it resemble a heading but with more than the allowed maximum of six levels. Current stable version is 4.0.1, ESM-only, requires Node.js 16+. It is part of the unified/remark ecosystem and ships TypeScript types. Unlike general linting presets, this rule specifically targets invalid heading-like paragraphs, catching common typos where users accidentally add extra hashes (e.g., ####### Venus). No options are needed. Releases follow the main remark-lint monorepo.
Common errors
error Error [ERR_REQUIRE_ESM]: require() of ES Module ↓
cause Using require() to load this ESM-only package.
fix
Change to import statement: import remarkLintNoHeadingLikeParagraph from 'remark-lint-no-heading-like-paragraph'
error TypeError: (intermediate value).use is not a function ↓
cause Forgetting to import remark-lint before this rule.
fix
Ensure you call .use(remarkLint) before .use(remarkLintNoHeadingLikeParagraph)
error Cannot find module 'remark-lint-no-heading-like-paragraph' ↓
cause Package not installed or import path incorrect.
fix
Run npm install remark-lint-no-heading-like-paragraph and ensure the import path is correct.
Warnings
breaking v4 is ESM-only; Node.js 16+ required. ↓
fix Use import instead of require, or stick with v3 if CommonJS is needed.
deprecated v3 is no longer maintained. ↓
fix Upgrade to v4 and switch to ESM.
gotcha The rule does not warn on headings with 1-6 hashes, only 7+. ↓
fix This is by design; use other rules like remark-lint-heading-style for heading linting.
Install
npm install remark-lint-no-heading-like-paragraph yarn add remark-lint-no-heading-like-paragraph pnpm add remark-lint-no-heading-like-paragraph Imports
- default wrong
const remarkLintNoHeadingLikeParagraph = require('remark-lint-no-heading-like-paragraph')correctimport remarkLintNoHeadingLikeParagraph from 'remark-lint-no-heading-like-paragraph' - remarkLintNoHeadingLikeParagraph wrong
import { remarkLintNoHeadingLikeParagraph } from 'remark-lint-no-heading-like-paragraph'correctimport remarkLintNoHeadingLikeParagraph from 'remark-lint-no-heading-like-paragraph' - type imports wrong
import type { remarkLintNoHeadingLikeParagraph } from 'remark-lint-no-heading-like-paragraph'correctimport type { Transformer } from 'unified'
Quickstart
import { unified } from 'unified';
import remarkParse from 'remark-parse';
import remarkStringify from 'remark-stringify';
import remarkLint from 'remark-lint';
import remarkLintNoHeadingLikeParagraph from 'remark-lint-no-heading-like-paragraph';
import { read } from 'to-vfile';
import { reporter } from 'vfile-reporter';
const file = await read('example.md');
const result = await unified()
.use(remarkParse)
.use(remarkLint)
.use(remarkLintNoHeadingLikeParagraph)
.use(remarkStringify)
.process(file);
console.error(reporter(result));