Registry / testing / remark-lint-first-heading-level

remark-lint-first-heading-level

JSON →
library4.0.1jsnpmunverified

remark-lint rule to enforce that the first heading in a Markdown document has a specific rank (1-6). Part of the remark-lint ecosystem. Current stable version 4.0.1, released as part of remark-lint monorepo with coordinated version bumps. Ships TypeScript types. ESM-only since v3. Works with unified, remark-parse, and remark-stringify.

npm install remark-lint-first-heading-level
INSTALL
IMPORT
SIG · REMARK-LINT-FIRST-
R
remark-lint-first-heading-level
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.

default
import remarkLintFirstHeadingLevel from 'remark-lint-first-heading-level'
const remarkLintFirstHeadingLevel = require('remark-lint-first-heading-level')
Package is ESM-only since v3, CommonJS require() will throw ERR_REQUIRE_ESM.
Options
import type { Options } from 'remark-lint-first-heading-level'
import { Options } from 'remark-lint-first-heading-level'
Options is a TypeScript type only, not a runtime export.
remarkLintFirstHeadingLevel
import remarkLintFirstHeadingLevel from 'remark-lint-first-heading-level'
This is the default export.

Checks that the first heading in example.md is rank 1, warns otherwise.

import { unified } from 'unified' import remarkParse from 'remark-parse' import remarkStringify from 'remark-stringify' import remarkLint from 'remark-lint' import remarkLintFirstHeadingLevel from 'remark-lint-first-heading-level' import { reporter } from 'vfile-reporter' import { read } from 'to-vfile' const file = await unified() .use(remarkParse) .use(remarkLint) .use(remarkLintFirstHeadingLevel, 1) // expect first heading level 1 .use(remarkStringify) .process(await read('example.md')) console.error(reporter(file))
remark --version
Debug
Known issues
breakingPackage is ESM-only since v3. CommonJS require() is not supported.
fix
Use import syntax or dynamic import().
affects: >=3.0.0
deprecatedOptions can be a number (1-6), but in future versions might be an object.
fix
Pass a number or check future releases for object config.
affects: >=4.0.0
Errors
Common errors & fixes
ERR_REQUIRE_ESM: require() of ES Module
Using require() to import an ESM-only package.
fix
Change to import statement or use dynamic import().
SyntaxError: Unexpected token 'export'
Running an ESM script with CommonJS module system.
fix
Add "type": "module" to package.json or use .mjs extension.
Upgrade
Version history
4.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
4
OpenAI (training)
2
Resources
remark-lint-first-heading-level — npm install remark-lint-first-heading-level · libregistry