{"id":27340,"library":"remark-lint-mdash-style","title":"remark-lint-mdash-style","description":"A remark-lint rule to enforce a consistent style for em dashes (mdash) in Markdown files. Version 1.1.1 is the current stable release, with no fixed release cadence. It offers three style options: '―' (Unicode em dash, default), '-' (single hyphen), and '--' (double hyphen). Unlike general-purpose linters, this package specifically targets mdash usage, a common typographic inconsistency. It is a lightweight plugin for the remark-lint ecosystem, primarily used in Node.js environments for CI or text processing pipelines. The package has no dependencies and is ESM-compatible but requires a CommonJS or ESM project that uses remark-lint.","status":"active","version":"1.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/alexandrtovmach/remark-lint-mdash-style","tags":["javascript","remark","remark-lint","markdown","lint","rule","mdash","minus"],"install":[{"cmd":"npm install remark-lint-mdash-style","lang":"bash","label":"npm"},{"cmd":"yarn add remark-lint-mdash-style","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-lint-mdash-style","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package is ESM-only since version 1.0.0; require() will throw an error. Use import or dynamic import.","wrong":"const remarkLintMdashStyle = require('remark-lint-mdash-style')","symbol":"default export","correct":"import remarkLintMdashStyle from 'remark-lint-mdash-style'"},{"note":"Options are passed directly to the plugin function, not nested under a key.","wrong":".use(remarkLintMdashStyle, { 'remark-lint-mdash-style': '--' })","symbol":"plugin in unified pipeline","correct":".use(remarkLintMdashStyle, { style: '--' })"},{"note":"The Options type is not exported as a value; use import type to avoid runtime errors.","wrong":"import { Options } from 'remark-lint-mdash-style'","symbol":"type import (TypeScript)","correct":"import type { Options } from 'remark-lint-mdash-style'"}],"quickstart":{"code":"import { remark } from 'remark';\nimport remarkLint from 'remark-lint';\nimport remarkLintMdashStyle from 'remark-lint-mdash-style';\n\nconst result = await remark()\n  .use(remarkLint)\n  .use(remarkLintMdashStyle, { style: '--' })\n  .process('Some text - with hyphen instead of dash.');\n\nif (result.messages.length > 0) {\n  console.log(result.messages[0].reason);\n} else {\n  console.log('No lint errors');\n}","lang":"typescript","description":"Shows how to use remark-lint-mdash-style with remark-lint in an ESM environment, including configuration and processing of a Markdown string."},"warnings":[{"fix":"Switch to import syntax or use dynamic import if in a CommonJS context.","message":"Package is ESM-only; CommonJS require() fails","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Consider using '--' or the Unicode em dash '—' instead, as single hyphen is ambiguous with bullet lists.","message":"Option style: '-' may be deprecated in future versions for clarity","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use .use(plugin, { style: '--' }) instead of .use(plugin, '--').","message":"Options must be passed as an object, not as a string directly","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"If you need to lint inline code, consider additional remark plugins.","message":"Rule only checks text nodes; inline code blocks are excluded","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Explicitly set a style that matches your project's conventions, e.g., '--'.","message":"The default style '―' (Unicode em dash) may not be visible in all editors","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install remark-lint-mdash-style' and ensure it is in dependencies.","cause":"Package not installed or not in node_modules","error":"Cannot find module 'remark-lint-mdash-style'"},{"fix":"Replace require() with import or use dynamic import: const plugin = (await import('remark-lint-mdash-style')).default;","cause":"Trying to use require() for an ESM-only package","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module ..."},{"fix":"Ensure you import the default export: import remarkLintMdashStyle from 'remark-lint-mdash-style'.","cause":"Importing the wrong symbol (default vs named) when using older bundlers","error":"TypeError: remarkLintMdashStyle is not a function"},{"fix":"Either change the text to use '—' or configure the rule with style: '--' or style: '-'.","cause":"The default style is the Unicode em dash, but the text contains a single hyphen","error":"warning: Use `―` instead of `-` for mdash"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}