JSPM

remark-lint-spaces-around-word

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

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

Package Exports

  • remark-lint-spaces-around-word

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-word) 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-word

According to chinese-document-style-guide, there should be spaces between English word and Chinese characters. This lint will warn when space is missing in such cases.

Example

valid.md

In

这是一份中文 API 文档。

Out

No messages.

invalid.md

In

这是一份中文API文档。

Out

input.md:1:7-1:9: Should have spaces around "API"

Install

npm install remark-lint-spaces-around-word

Usage

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

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

Or use it on the CLI directly

remark -u remark-lint -u remark-lint-spaces-around-word 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-word'))
   .process('_Emphasis_ and **importance**', function (err, file) {
     console.error(report(err || file));
   });

License

MIT © LaySent