{"id":26260,"library":"remark-lint-no-heading-punctuation","title":"remark-lint-no-heading-punctuation","description":"A remark-lint rule that warns when headings end in illegal characters such as punctuation marks. The current stable version is 4.0.1. It is part of the remark-lint ecosystem and is included in presets like `remark-preset-lint-markdown-style-guide`. It supports configurable options via a RegExp or string, allowing customization of which characters are flagged. This package is ESM-only and ships TypeScript types. It is actively maintained as part of the remark-lint monorepo.","status":"active","version":"4.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/remarkjs/remark-lint#main","tags":["javascript","character","heading","lint","remark","remark-lint","remark-lint-rule","rule","typescript"],"install":[{"cmd":"npm install remark-lint-no-heading-punctuation","lang":"bash","label":"npm"},{"cmd":"yarn add remark-lint-no-heading-punctuation","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-lint-no-heading-punctuation","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package is ESM-only since v4; CommonJS require will fail.","wrong":"const remarkLintNoHeadingPunctuation = require('remark-lint-no-heading-punctuation')","symbol":"default","correct":"import remarkLintNoHeadingPunctuation from 'remark-lint-no-heading-punctuation'"},{"note":"The rule must be used after the `remark-lint` plugin itself (or a preset that includes it).","wrong":"unified().use(remarkLintNoHeadingPunctuation)","symbol":"remarkLintNoHeadingPunctuation (used with .use)","correct":"import remarkLint from 'remark-lint'\nimport remarkLintNoHeadingPunctuation from 'remark-lint-no-heading-punctuation'\nunified().use(remarkLint).use(remarkLintNoHeadingPunctuation)"},{"note":"The package does not export additional types aside from the default function; options can be typed inline.","wrong":"","symbol":"TypeScript type import","correct":"import type { RemarkLintNoHeadingPunctuationOptions } from 'remark-lint-no-heading-punctuation'"}],"quickstart":{"code":"import { unified } from 'unified'\nimport remarkParse from 'remark-parse'\nimport remarkStringify from 'remark-stringify'\nimport remarkLint from 'remark-lint'\nimport remarkLintNoHeadingPunctuation from 'remark-lint-no-heading-punctuation'\nimport { reporter } from 'vfile-reporter'\n\nconst file = await unified()\n  .use(remarkParse)\n  .use(remarkLint)\n  .use(remarkLintNoHeadingPunctuation)\n  .use(remarkStringify)\n  .process('# Mercury:')\n\nconsole.error(reporter(file))\n// Output: 1:1-1:10: Unexpected character `:` at end of heading, remove it","lang":"typescript","description":"Demonstrates usage of the remark-lint-no-heading-punctuation rule in a unified pipeline, processing a markdown file and reporting lint messages."},"warnings":[{"fix":"Use `import` syntax instead of `require()`. Ensure your project is ESM or use dynamic import().","message":"Since version 4, the package is ESM-only and no longer supports CommonJS require().","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Pass a RegExp or an object with `source` property: `{ source: '[,:;]' }`.","message":"Options provided as a plain string are deprecated in favor of explicit RegExp or source object.","severity":"deprecated","affected_versions":">=4.0.0"},{"fix":"Use RegExp directly or escape regex special characters in the string.","message":"When using a string option, it is wrapped in `new RegExp('[' + x + ']', 'u')` so characters like '.' need escaping.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Ensure `.use(remarkLint)` is called before `.use(remarkLintNoHeadingPunctuation)`.","message":"The rule must be used after the `remark-lint` plugin; otherwise it will not work.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Use Node 16 or later, or use dynamic imports in older Node with `--experimental-modules`.","message":"In Node.js, the environment must support ESM (Node 16+).","severity":"gotcha","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":"Use `import remarkLintNoHeadingPunctuation from 'remark-lint-no-heading-punctuation'` instead of `require(...)`.","cause":"Attempting to use CommonJS require() on an ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module not supported."},{"fix":"Remove the trailing punctuation from the heading, or configure the rule to allow specific characters.","cause":"Heading ends with a punctuation mark that is disallowed by the rule's default configuration.","error":"Unexpected character `:` at end of heading, remove it"},{"fix":"Use `import remarkLintNoHeadingPunctuation from 'remark-lint-no-heading-punctuation'` (default import).","cause":"The default export is imported incorrectly (e.g., using named import instead of default).","error":"TypeError: remarkLintNoHeadingPunctuation is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}