remark-lint-no-repeat-punctuation

remark lint plugin that will warn when multiple punctuations found in series.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
remark-lint-no-repeat-punctuation
180.1.43 years ago5 years agoMinified + gzip package size for remark-lint-no-repeat-punctuation in KB

Readme

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