Lists
How the formatter normalizes list indentation and spacing
The formatter normalizes list indentation. Spacing around lists is preserved as-is.
Rules
List markers (
-,*,+,1.) are preserved as-isLeading spaces on top-level list items are removed
Nested lists are indented consistently
Examples
Remove leading spaces
Before:
- First item
- Second item
- Third itemAfter:
- First item
- Second item
- Third itemNested lists
Before:
- Parent item
- Nested item 1
- Nested item 2
- Another parentAfter:
- Parent item
- Nested item 1
- Nested item 2
- Another parentNumbered lists
Before:
1. First item
2. Second item
3. Third itemAfter:
1. First item
2. Second item
3. Third item