{"id":26281,"library":"remark-lint-rule-style","title":"remark-lint-rule-style","description":"A remark-lint rule to warn when thematic breaks (horizontal rules) are inconsistent. Current stable version is 4.0.1, part of the remark-lint ecosystem (ESM-only, Node 16+). Enforces a consistent style for horizontal rule markers and spacing. Key differentiator: detects the first used style automatically (`'consistent'` option) or allows explicit string like `'---'`. Works with remark-lint presets like `remark-preset-lint-consistent` and `remark-preset-lint-markdown-style-guide`.","status":"active","version":"4.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/remarkjs/remark-lint#main","tags":["javascript","break","horizontal","lint","remark","remark-lint","remark-lint-rule","rule","thematic","typescript"],"install":[{"cmd":"npm install remark-lint-rule-style","lang":"bash","label":"npm"},{"cmd":"yarn add remark-lint-rule-style","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-lint-rule-style","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"core dependency providing the lint rule interface","package":"unified-lint-rule","optional":false},{"reason":"used for message control features","package":"remark-message-control","optional":false},{"reason":"provides TypeScript types for mdast nodes","package":"@types/mdast","optional":true}],"imports":[{"note":"ESM-only since v4. CommonJS require will throw error.","wrong":"const remarkLintRuleStyle = require('remark-lint-rule-style')","symbol":"remarkLintRuleStyle","correct":"import remarkLintRuleStyle from 'remark-lint-rule-style'"},{"note":"Options is a type, not a runtime export. Use 'import type' for TypeScript or '// @ts-expect-error' if mistakenly imported as value.","wrong":"import { Options } from 'remark-lint-rule-style'","symbol":"Options","correct":"import type { Options } from 'remark-lint-rule-style'"},{"note":"Second argument should be an options object, not a plain string unless it's 'consistent'. For explicit styles, use `{ style: '---' }`.","wrong":"unified().use(remarkLintRuleStyle, '---')","symbol":"default export (remarkLintRuleStyle)","correct":"unified().use(remarkLintRuleStyle, { style: '---' })"}],"quickstart":{"code":"import { unified } from 'unified'\nimport remarkParse from 'remark-parse'\nimport remarkStringify from 'remark-stringify'\nimport remarkLint from 'remark-lint'\nimport remarkLintRuleStyle from 'remark-lint-rule-style'\nimport { reporter } from 'vfile-reporter'\n\nconst file = await unified()\n  .use(remarkParse)\n  .use(remarkLint)\n  .use(remarkLintRuleStyle, { style: '---' })\n  .use(remarkStringify)\n  .process('***\\n\\n---')\n\nconsole.error(reporter(file))","lang":"typescript","description":"Lint a markdown string and report warnings for inconsistent horizontal rule styles."},"warnings":[{"fix":"Use ESM imports: import remarkLintRuleStyle from 'remark-lint-rule-style'","message":"v4 dropped CommonJS support; require() will throw.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Upgrade Node.js to >=16","message":"v4 requires Node 16+.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Use { style: '---' } instead of '---'","message":"Passing string directly as options (e.g., '---') is deprecated in v4; use object form.","severity":"deprecated","affected_versions":">=4.0.0"},{"fix":"Use 'consistent' directly: .use(remarkLintRuleStyle, 'consistent')","message":"Options type 'consistent' is a string, not an object. { style: 'consistent' } works but can be simplified to just the string.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use import type { Options } from 'remark-lint-rule-style'","message":"TypeScript users may mistakenly import Options as a value; it's a type-only export.","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":"Switch to import statement: import remarkLintRuleStyle from 'remark-lint-rule-style'","cause":"Using CommonJS require() on an ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module"},{"fix":"Use default import: import remarkLintRuleStyle from 'remark-lint-rule-style'","cause":"Importing default export incorrectly (e.g., using named import for default).","error":"TypeError: remarkLintRuleStyle is not a function"},{"fix":"Run: npm install remark-lint-rule-style","cause":"Package not installed or typo in package name.","error":"Error: Cannot find module 'remark-lint-rule-style'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}