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

remark-lint-spaces-around-number

JSON →
library0.1.2jsnpmunverified

A remark-lint plugin (v0.1.2) enforcing spacing between numbers and Chinese characters per the Chinese Document Style Guide. It warns when a number (including percentages) is directly adjacent to Chinese text without a space. Designed for use with remark-lint, it integrates into remark CLI, config files, or API. Differs from general lint rules by targeting CJK typographic conventions; actively maintained with irregular release cadence.

npm install remark-lint-spaces-around-number
INSTALL
IMPORT
SIG · REMARK-LINT-SPACES
R
remark-lint-spaces-around-number
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 remarkLintSpacesAroundNumber from 'remark-lint-spaces-around-number'
const { remarkLintSpacesAroundNumber } = require('remark-lint-spaces-around-number')
Package has a default export; named destructuring will fail.
remark
import remark from 'remark'
var remark = require('remark')
ESM import preferred; require may work but not guaranteed.
remarkLint
import remarkLint from 'remark-lint'
import { remarkLint } from 'remark-lint'
remark-lint is default export; named import results in undefined.

Shows usage with remark API: process markdown and catch missing space between number and Chinese.

import remark from 'remark'; import remarkLint from 'remark-lint'; import remarkLintSpacesAroundNumber from 'remark-lint-spaces-around-number'; import report from 'vfile-reporter'; remark() .use(remarkLint) .use(remarkLintSpacesAroundNumber) .process('理财产品的收益是 4.0%左右。', (err, file) => { console.error(report(err || file)); }); // Output: 1:10-1:13 warning Should have space after "4.0%"
remark --version
Debug
Known issues
gotchaPlugin only works with remark-lint and unified ecosystem
fix
Ensure remark-lint is installed and used as a plugin before this one.
affects: >=0.1.0
gotchaDefault export; named import will yield undefined
fix
Use default import: import pkg from 'remark-lint-spaces-around-number'
affects: >=0.1.0
breakingIncompatible with remark 13+ if using older plugin API
fix
Upgrade to v0.1.0 or later which uses unified-lint-rule
affects: <0.1.0
deprecatedConsole usage via require('remark-lint-spaces-around-number') may stop working in future ESM-only releases
fix
Use import syntax
affects: >=0.1.0
Errors
Common errors & fixes
TypeError: remarkLintSpacesAroundNumber is not a function
Named import of default-exported package
fix
Use `import remarkLintSpacesAroundNumber from 'remark-lint-spaces-around-number'`
Error: Cannot find module 'remark-lint'
remark-lint not installed as a dependency
fix
Run `npm install remark-lint`
Warning: unknown rule "spaces-around-number"
Plugin not registered in remark config or .use() chain before remark-lint
fix
Add `remark-lint-spaces-around-number` as a plugin after `remark-lint`
Upgrade
Version history
0.1.2latest on npm
Audit
Dependencies
remark-lintrequiredPeer dependency required to run lint rules
unifiedrequiredUnderlying unified ecosystem required by remark
Agent activity
4 hits · last 30 days
node
4
Resources
remark-lint-spaces-around-number — npm install remark-lint-spaces-around-number · libregistry