Licence
MIT
Version
0.2.0
Deps
1
Size
55 kB
Vulns
0
Weekly
0
markdownlint-rule-indent-alignment
What?
This is a custom markdownlint rule to lint the alignment of list items and blocks (e.g. code blocks). For example:
| Invalid | Valid |
|---|---|
Lorem ipsum dolor sit amet |
Lorem ipsum dolor sit amet |
* Lorem ipsum |
* Lorem ipsum |
1. Lorem ipsum |
1. Lorem ipsum |
* Lorem ipsum dolor sit amet |
* Lorem ipsum dolor sit amet |
1. Lorem ipsum dolor sit amet |
1. Lorem ipsum dolor sit amet |
* Lorem: |
* Lorem: |
> Lorem ipsum dolor sit amet |
> Lorem ipsum dolor sit amet |
Usage
To use this custom markdownlint rule two things needed:
Update your markdownlint config to include
"indent-alignment": trueAdd this rule to the list of custom markdownlint rules. If using markdownlint-cli, this would look something like:
markdownlint -r './node_modules/@silvermine/markdownlint-rule-indent-alignment/src/indent-alignment.js' -c .markdownlint.json README.md
Rule configuration
This rule has the following config options:
ul_indent: Desired indention ofullists (number, defaultundefined)- By default, child
ulitems will be aligned with the content. Whenul_indentis set, the rule will replicate the behavior of theul-indent(MD007) rule. - Examples:
ul_indent: undefined* top-level item * sub-itemul_indent: 3* top-level item * sub-item
- By default, child
start_indent: Desired indention of all top-level lists (number, defaultundefined)- By default, top-level lists are allowed to be indented at any level as long as
it's consistent. When
start_indentis set, then any top-level list must be indented at that level. - Examples:
start_indent: 3* top-level item * sub-item 1. top-level item 1. sub-item
- By default, top-level lists are allowed to be indented at any level as long as
it's consistent. When
License
This software is released under the MIT license. See the license file for more details.