Registry / testing / remark-lint-match-punctuation

remark-lint-match-punctuation

JSON →
library0.2.1jsnpmunverified

A remark-lint rule that warns when paired punctuation marks (e.g., parentheses, quotation marks, brackets) are not properly matched. Version 0.2.1 is the latest release, with no frequent updates. It focuses on non-ASCII pairs like Chinese quotation marks and angle quotes. Unlike general remark-lint rules, this plugin specifically targets punctuation mismatches that are not covered by standard linting.

npm install remark-lint-match-punctuation
INSTALL
IMPORT
SIG · REMARK-LINT-MATCH-
R
remark-lint-match-punctuation
testingjavascriptv0.2.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.

remarkLintMatchPunctuation
import remarkLintMatchPunctuation from 'remark-lint-match-punctuation'
const remarkLintMatchPunctuation = require('remark-lint-match-punctuation')
Default export; CJS require also works but ESM is preferred for new code.
plugin options
remark().use(remarkLintMatchPunctuation, ['()'])
Options are passed as an array of strings, each with left and right character.
remarkConfig
"remark-lint-match-punctuation": true
"remark-lint-match-punctuation": ["()"]
In configuration files, the plugin name is a key; options are the value. Array options must be wrapped in an extra array: ["()"] becomes ["remark-lint-match-punctuation", ["()"]].

Demonstrates using the plugin with remark programmatically to lint a markdown file for punctuation pair mismatches.

import { remark } from 'remark'; import remarkLint from 'remark-lint'; import remarkLintMatchPunctuation from 'remark-lint-match-punctuation'; import { readSync } from 'to-vfile'; import { reporter } from 'vfile-reporter'; const file = readSync('./readme.md'); remark() .use(remarkLint) .use(remarkLintMatchPunctuation) .process(file, (err, result) => { console.error(reporter(err || result)); });
Debug
Known issues
gotchaThe plugin only checks explicitly listed punctuation pairs. Custom characters may not be caught unless passed as options.
fix
Pass custom pairs as an array of two-character strings to the plugin.
affects: 0.0.0 - 0.2.1
breakingNo breaking changes documented; handle with care.
fix
Review changelog for any future updates.
affects: >=0.2.0
gotchaThe plugin does not ignore punctuation inside code blocks or inline code by default.
fix
Use a custom markdown node walker to skip these cases, or combine with other remark plugins.
affects: 0.0.0 - 0.2.1
Errors
Common errors & fixes
Error: Cannot find module 'remark-lint-match-punctuation'
Package not installed.
fix
Run `npm install remark-lint-match-punctuation`
TypeError: Cannot read properties of undefined (reading 'match-punctuation')
Plugin not registered correctly in remark configuration.
fix
Ensure the config has "remark-lint-match-punctuation": true and that remark-lint is also used.
Invalid option for plugin remark-lint-match-punctuation: expected array of 2-character strings
Options passed in wrong format.
fix
Pass options as an array of strings where each string is exactly two characters (left and right pair).
Upgrade
Version history
0.2.1latest on npm
Audit
Dependencies
remark-lintrequiredpeer dependency needed to register the rule
Agent activity
2 hits · last 30 days
node
2
Resources
remark-lint-match-punctuation — npm install remark-lint-match-punctuation · libregistry