remark-lint-checkbox-content-indent

2018-11-14 admin

remark-lint-checkbox-content-indent是什么

什么是remark-lint-checkbox-content-indent,remark-lint rule to warn when list item checkboxes are followed by too much white-space

remark-lint-checkbox-content-indent使用教程帮助文档

remark-lint-checkbox-content-indent

Warn when list item checkboxes are followed by too much white-space.

Presets

This rule is not included in any default preset

Example

valid.md
In
- [ ] List item
+  [x] List Item
*   [X] List item
-    [ ] List item
Out

No messages.

invalid.md
In
- [ ] List item
+ [x]  List item
* [X]   List item
- [ ]    List item
Out
2:7-2:8: Checkboxes should be followed by a single character
3:7-3:9: Checkboxes should be followed by a single character
4:7-4:10: Checkboxes should be followed by a single character

Install

npm install remark-lint-checkbox-content-indent

Usage

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

 ...
 "remarkConfig": {
   "plugins": [
     ...
     "lint",
+    "lint-checkbox-content-indent",
     ...
   ]
 }
 ...

Or use it on the CLI directly

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

License

MIT © Titus Wormer

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-45388.html

文章标题:remark-lint-checkbox-content-indent

回到顶部