JSPM

remark-lint-spaces-around-number

0.1.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1011
  • Score
    100M100P100Q120644F
  • License MIT

remark lint plugin that checks if there are spaces between number and Chinese

Package Exports

  • remark-lint-spaces-around-number

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (remark-lint-spaces-around-number) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

remark-lint-spaces-around-number

According to chinese-document-style-guide, one way of organize number and Chinese is to have space in between. This lint will warn when space is missing in such cases.

Example

valid.md

In

理财产品的收益是 4.0% 左右。

Out

No messages.

invalid.md

In

理财产品的收益是 4.0%左右。

Out

input.md:1:10-1:13: Should have space after "4.0%"

Install

npm install remark-lint-spaces-around-number

Usage

You probably want to use it on the CLI through a config file:

 ...
 "remarkConfig": {
   "plugins": [
     ...
     "remark-lint",
+    "remark-lint-spaces-around-number",
     ...
   ]
 }
 ...

Or use it on the CLI directly

remark -u remark-lint -u remark-lint-spaces-around-number readme.md

Or use this on the API:

 var remark = require('remark');
 var report = require('vfile-reporter');

 remark()
   .use(require('remark-lint'))
+  .use(require('remark-lint-spaces-around-number'))
   .process('_Emphasis_ and **importance**', function (err, file) {
     console.error(report(err || file));
   });

License

MIT © LaySent