{"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,"search_vec":"'-6':26 '1':25 '4.0.1':37 'bump':49 'coordin':47 'current':34 'depth':69 'document':20 'ecosystem':33 'enforc':12 'esm':54 'esm-on':53 'first':4,15,70 'head':5,16,71 'javascript':68 'level':6,72 'lint':3,9,32,44,73,77,80 'markdown':19 'monorepo':45 'pars':63 'part':27,40 'rank':24 'releas':38 'remark':2,8,31,43,62,66,74,76,79 'remark-lint':7,30,42,75 'remark-lint-first-heading-level':1 'remark-lint-rul':78 'remark-pars':61 'remark-stringifi':65 'rule':10,81 'ship':50 'sinc':56 'specif':23 'stabl':35 'stringifi':67 'type':52 'typescript':51,82 'unifi':60 'v3':57 'version':36,48 'work':58","created_at":"2026-05-01T13:48:48.266154+00:00","updated_at":"2026-05-01T13:48:48.266154+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"remark","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/remarkjs/remark-lint.git#main","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/remark-lint-first-heading-level","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}