{"id":26212,"library":"remark-lint-first-heading-level","title":"remark-lint-first-heading-level","description":"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.","status":"active","version":"4.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/remarkjs/remark-lint#main","tags":["javascript","depth","first","heading","level","lint","remark","remark-lint","remark-lint-rule","typescript"],"install":[{"cmd":"npm install remark-lint-first-heading-level","lang":"bash","label":"npm"},{"cmd":"yarn add remark-lint-first-heading-level","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-lint-first-heading-level","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package is ESM-only since v3, CommonJS require() will throw ERR_REQUIRE_ESM.","wrong":"const remarkLintFirstHeadingLevel = require('remark-lint-first-heading-level')","symbol":"default","correct":"import remarkLintFirstHeadingLevel from 'remark-lint-first-heading-level'"},{"note":"Options is a TypeScript type only, not a runtime export.","wrong":"import { Options } from 'remark-lint-first-heading-level'","symbol":"Options","correct":"import type { Options } from 'remark-lint-first-heading-level'"},{"note":"This is the default export.","wrong":null,"symbol":"remarkLintFirstHeadingLevel","correct":"import remarkLintFirstHeadingLevel from 'remark-lint-first-heading-level'"}],"quickstart":{"code":"import { unified } from 'unified'\nimport remarkParse from 'remark-parse'\nimport remarkStringify from 'remark-stringify'\nimport remarkLint from 'remark-lint'\nimport remarkLintFirstHeadingLevel from 'remark-lint-first-heading-level'\nimport { reporter } from 'vfile-reporter'\nimport { read } from 'to-vfile'\n\nconst file = await unified()\n  .use(remarkParse)\n  .use(remarkLint)\n  .use(remarkLintFirstHeadingLevel, 1) // expect first heading level 1\n  .use(remarkStringify)\n  .process(await read('example.md'))\n\nconsole.error(reporter(file))","lang":"typescript","description":"Checks that the first heading in example.md is rank 1, warns otherwise."},"warnings":[{"fix":"Use import syntax or dynamic import().","message":"Package is ESM-only since v3. CommonJS require() is not supported.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Pass a number or check future releases for object config.","message":"Options can be a number (1-6), but in future versions might be an object.","severity":"deprecated","affected_versions":">=4.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Change to import statement or use dynamic import().","cause":"Using require() to import an ESM-only package.","error":"ERR_REQUIRE_ESM: require() of ES Module"},{"fix":"Add \"type\": \"module\" to package.json or use .mjs extension.","cause":"Running an ESM script with CommonJS module system.","error":"SyntaxError: Unexpected token 'export'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}