Registry / testing / remark-lint-no-emphasis-as-heading

remark-lint-no-emphasis-as-heading

JSON →
library4.0.1jsnpmunverified

remark-lint rule to warn when emphasis or strong is used instead of a heading. Current stable version: 4.0.1. Part of the remark-lint ecosystem, released as needed with other lint rules. Differentiator: specifically targets faux headings created with emphasis/strong, promoting proper heading usage. ESM-only, ships TypeScript types.

npm install remark-lint-no-emphasis-as-heading
INSTALL
IMPORT
SIG · REMARK-LINT-NO-EMP
R
remark-lint-no-emphasis-as-heading
testingjavascriptv4.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.

remarkLintNoEmphasisAsHeading
import remarkLintNoEmphasisAsHeading from 'remark-lint-no-emphasis-as-heading'
import { remarkLintNoEmphasisAsHeading } from 'remark-lint-no-emphasis-as-heading'
Default export only; named import will fail. ESM-only since v4.
remarkLint
import remarkLint from 'remark-lint'
import { remarkLint } from 'remark-lint'
remark-lint also uses default export.
unified
import { unified } from 'unified'
import unified from 'unified'
unified uses named export.

Sets up unified with remark-lint and the no-emphasis-as-heading rule, processes a markdown file, and reports lint messages.

import remarkLint from 'remark-lint' import remarkLintNoEmphasisAsHeading from 'remark-lint-no-emphasis-as-heading' import remarkParse from 'remark-parse' import remarkStringify from 'remark-stringify' import { unified } from 'unified' import { reporter } from 'vfile-reporter' const file = await unified() .use(remarkParse) .use(remarkLint) .use(remarkLintNoEmphasisAsHeading) .use(remarkStringify) .process('# Hello\n\n**World**\n\nThis is a paragraph.') console.error(reporter(file))
Debug
Known issues
breakingPackage is ESM-only since v4; require() will throw ERR_REQUIRE_ESM
fix
Use import or dynamic import() instead of require().
affects: >=4.0.0
gotchaDefault export only: import remarkLintNoEmphasisAsHeading from 'remark-lint-no-emphasis-as-heading' (not a named export)
fix
Use default import syntax.
affects: >=4.0.0
gotchaThe rule must be used after remark-lint plugin; order matters
fix
Ensure .use(remarkLint) precedes .use(remarkLintNoEmphasisAsHeading).
affects: >=3.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
Using require() with ESM-only package (v4+).
fix
Switch to import or set type: module in package.json.
TypeError: remarkLintNoEmphasisAsHeading is not a function
Named import attempt: import { remarkLintNoEmphasisAsHeading } from '...'
fix
Use default import: import remarkLintNoEmphasisAsHeading from '...'
Upgrade
Version history
4.0.1latest on npm
Audit
Dependencies
unifiedrequiredrequired to integrate with unified processor
remark-lintrequiredrequired as the lint framework
Agent activity
4 hits · last 30 days
node
4
Resources
remark-lint-no-emphasis-as-heading — npm install remark-lint-no-emphasis-as-heading · libregistry