Registry / testing / remark-lint-emphasis-marker

remark-lint-emphasis-marker

JSON →
library4.0.1jsnpmunverified

remark-lint rule to warn when emphasis markers (asterisks vs underscores) violate a given or consistent style. Current stable version is 4.0.1, ESM-only, requires Node.js 16+. Part of the unified/remark ecosystem, ships TypeScript types. Integrates with remark-lint presets like `remark-preset-lint-consistent` and `remark-preset-lint-markdown-style-guide`. Distributed as a scoped package on npm. Includes CLI support via remark CLI.

npm install remark-lint-emphasis-marker
INSTALL
IMPORT
SIG · REMARK-LINT-EMPHAS
R
remark-lint-emphasis-marker
testingjavascriptv4.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import remarkLintEmphasisMarker from 'remark-lint-emphasis-marker'
const remarkLintEmphasisMarker = require('remark-lint-emphasis-marker')
Package is ESM-only since v4. CommonJS require will throw an error.
type Marker
import type { Marker } from 'remark-lint-emphasis-marker'
import { Marker } from 'remark-lint-emphasis-marker'
Marker is a TypeScript type export, not a runtime value. Use 'import type' or 'import { type Marker }'
type Options
import type { Options } from 'remark-lint-emphasis-marker'
import { Options } from 'remark-lint-emphasis-marker'
Options is a TypeScript type export, not a runtime value. Use 'import type' or 'import { type Options }'

Lint emphasis markers in a Markdown file, enforcing asterisks as the preferred marker.

import { unified } from 'unified'; import remarkParse from 'remark-parse'; import remarkStringify from 'remark-stringify'; import remarkLint from 'remark-lint'; import remarkLintEmphasisMarker from 'remark-lint-emphasis-marker'; import { read } from 'to-vfile'; import { reporter } from 'vfile-reporter'; const file = await read('example.md'); await unified() .use(remarkParse) .use(remarkLint) .use(remarkLintEmphasisMarker, '*') .use(remarkStringify) .process(file); console.error(reporter(file));
remark --version
Debug
Known issues
breakingPackage is ESM-only starting from v4.0.0. Requires Node.js 16+ and cannot be required with CommonJS.
fix
Use import syntax and ensure Node.js 16+. If you must use CommonJS, stick with v3.x.
affects: >=4.0.0
gotchaThe default option is 'consistent', which auto-detects the first emphasis marker and warns on mismatches. Explicitly setting to '*' or '_' enforces that specific marker.
fix
Specify the desired marker explicitly to avoid unexpected behavior: .use(remarkLintEmphasisMarker, '*')
affects: >=1.0.0
deprecatedTypeScript type Options previously accepted arbitrary strings; now tightly typed as Marker | 'consistent'.
fix
Update TypeScript usage to only use '*' | '_' | 'consistent'.
affects: >=4.0.0
gotchaOnly supports '*' and '_' markers. Other characters (like '~') are not valid for emphasis in Markdown and are ignored by this rule.
fix
Use only '*' or '_' for emphasis markers in Markdown content.
affects: >=1.0.0
Errors
Common errors & fixes
ERR_REQUIRE_ESM: require() of ES Module not supported
Using CommonJS require() on an ESM-only package.
fix
Switch to import syntax: import remarkLintEmphasisMarker from 'remark-lint-emphasis-marker';
TypeError: remarkLintEmphasisMarker is not a function
Missing or incorrect usage with unified: possibly forgot .use() or passed options incorrectly.
fix
Ensure correct usage: unified().use(remarkLintEmphasisMarker, '*'). The function is a plugin, not a standalone linter.
Cannot find module 'remark-lint'
Missing required peer dependency 'remark-lint'.
fix
Install remark-lint: npm install remark-lint
Upgrade
Version history
4.0.1latest on npm
Audit
Dependencies
unifiedrequiredCore unified processor required for remark plugins
remark-lintrequiredRequired to provide lint infrastructure and report warnings
remark-parseoptionalNeeded to parse Markdown input in API usage examples
remark-stringifyoptionalNeeded to stringify output in API usage examples
Agent activity
2 hits · last 30 days
node
2
Resources
remark-lint-emphasis-marker — npm install remark-lint-emphasis-marker · libregistry