unified

Project: laysent/remark-lint-plugins

Package: remark-lint-no-repeat-punctuation@0.1.4

  1. Dependents: 4
  2. remark lint plugin that will warn when multiple punctuations found in series.
  1. remark 196
  2. lint 77
  3. rule 72
  4. remark-lint 11

remark-lint-no-repeat-punctuation

Warn when punctuations are used repeatedly. By default, following punctuations are only allowed to be appeared alone:

, !, ~, , ., , ,, , ·, ?, .

Example

valid.md

In

好好学习,天天向上!

Out

No messages.

invalid.md

In

好好学习,天天向上!!!
好好学习,天天向上~~~
好好学习,天天向上。。。
好好学习,天天向上???

Out

input.md:1:11: Should not repeat "!"
input.md:1:12: Should not repeat "!"
input.md:2:11: Should not repeat "~"
input.md:2:12: Should not repeat "~"
input.md:3:11: Should not repeat "。"
input.md:3:12: Should not repeat "。"
input.md:4:11: Should not repeat "?"
input.md:4:12: Should not repeat "?"

Install

npm install remark-lint-no-repeat-punctuation

Usage

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

 ...
 "remarkConfig": {
   "plugins": [
     ...
     "remark-lint",
+    "remark-lint-no-repeat-punctuation",
     ...
   ]
 }
 ...

Or use it on the CLI directly

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

License

MIT © LaySent