Registry / testing / remark-lint-spaces-around-word

remark-lint-spaces-around-word

JSON →
library0.1.2jsnpmunverified

A remark-lint plugin that checks for missing spaces between English words and Chinese characters in Markdown files, following the chinese-document-style-guide. Version 0.1.2 is the latest and stable release, with no active development indicated. It is a niche tool specifically for bilingual (Chinese-English) document formatting, differentiating from general remark-lint rules by targeting a specific typographic convention. The plugin has low release cadence and is best used with remark-lint.

npm install remark-lint-spaces-around-word
INSTALL
IMPORT
SIG · REMARK-LINT-SPACES
R
remark-lint-spaces-around-word
testingjavascriptv0.1.2
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 remarkLintSpacesAroundWord from 'remark-lint-spaces-around-word'
import { remarkLintSpacesAroundWord } from 'remark-lint-spaces-around-word'
This package exports a single function as default. Named import will yield undefined.
remark
import remark from 'remark'
const remark = require('remark')
remark is ESM-only since v14. For CJS, use dynamic import or use older version.
require (CommonJS)
const remarkLintSpacesAroundWord = require('remark-lint-spaces-around-word')
In CJS environments, this is the standard way to import. No wrong pattern commonly observed.

Demonstrates how to programmatically use remark-lint-spaces-around-word to lint a Markdown file, showing the process of reading a file, running the plugin, and outputting lint messages.

import { readSync } from 'fs'; import { remark } from 'remark'; import remarkLint from 'remark-lint'; import remarkLintSpacesAroundWord from 'remark-lint-spaces-around-word'; import { reporter } from 'vfile-reporter'; const file = readSync('invalid.md', 'utf8'); const result = remark() .use(remarkLint) .use(remarkLintSpacesAroundWord) .processSync(file); console.error(reporter(result));
Debug
Known issues
gotchaPlugin only detects missing spaces when English word is surrounded by Chinese characters, not the reverse or other languages.
fix
Ensure the English word has Chinese characters on both sides; otherwise the rule may not trigger.
affects: all
gotchaThe plugin does not handle punctuation boundaries; e.g., '中文API。' will warn because of missing space before 'API' even though period follows.
fix
Manually review warnings; consider additional processing for punctuation.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'remark-lint-spaces-around-word'
Package not installed or not in node_modules.
fix
Run 'npm install remark-lint-spaces-around-word' in your project.
TypeError: Cannot read properties of undefined (reading 'SpacesAroundWord')
Using named import instead of default import.
fix
Use default import: import remarkLintSpacesAroundWord from 'remark-lint-spaces-around-word'
Upgrade
Version history
0.1.2latest on npm
Audit
Dependencies
remark-lintrequiredremark-lint is required as a dependency for the plugin to work; this plugin is a rule for remark-lint.
unifiedoptionalunified is required by remark ecosystem, but not a direct peer dependency; included for context.
Agent activity
2 hits · last 30 days
node
2
Resources
remark-lint-spaces-around-word — npm install remark-lint-spaces-around-word · libregistry