Registry /
testing / remark-lint-first-heading-level
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
Errors
Common errors & fixes
ERR_REQUIRE_ESM: require() of ES Module
Using require() to import an ESM-only package.
fixChange to import statement or use dynamic import().
SyntaxError: Unexpected token 'export'
Running an ESM script with CommonJS module system.
fixAdd "type": "module" to package.json or use .mjs extension.
Audit
Dependencies
No dependency data recorded yet.