Skip to content

Commit b1f4e2d

Browse files
Merge pull request #1803 from IgniteUI/mt/lint-md-fixes
lint md fixes
2 parents e9972cd + 33003fa commit b1f4e2d

File tree

552 files changed

+9268
-14480
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

552 files changed

+9268
-14480
lines changed

.markdownlint-README.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Markdown Linting Configuration
2+
3+
## Overview
4+
This directory contains markdown linting configuration for the Ignite UI for Angular documentation.
5+
6+
7+
## TODO
8+
9+
Add devDependencies:
10+
11+
- "markdownlint-cli": "^0.45.0",
12+
- "cspell": "^9.2.2",
13+
14+
## Rules Configuration
15+
16+
The `.markdownlint.json` file configures markdown-lint with relaxed rules suitable for technical documentation:
17+
18+
### Enabled Rules
19+
- **MD001**: Heading levels should only increment by one level at a time
20+
- **MD003**: Heading style (ATX style with #)
21+
- **MD004**: Unordered list style (dash)
22+
- **MD007**: Unordered list indentation (2 spaces)
23+
- **MD009**: Trailing spaces (allow 2 for line breaks)
24+
- **MD010**: Hard tabs
25+
- **MD012**: Multiple consecutive blank lines (max 2)
26+
- **MD014**: Dollar signs used before commands without showing output
27+
- **MD018**: No space after hash on atx style heading
28+
- **MD019**: Multiple spaces after hash on atx style heading
29+
- **MD022**: Headings should be surrounded by blank lines
30+
- **MD023**: Headings must start at the beginning of the line
31+
- **MD024**: Multiple headings with the same content (siblings only)
32+
- **MD025**: Multiple top-level headings in the same document
33+
- **MD026**: Trailing punctuation in heading
34+
- **MD027**: Multiple spaces after blockquote symbol
35+
- **MD028**: Blank line inside blockquote
36+
- **MD029**: Ordered list item prefix (ordered style)
37+
- **MD030**: Spaces after list markers
38+
- **MD031**: Fenced code blocks should be surrounded by blank lines
39+
- **MD032**: Lists should be surrounded by blank lines
40+
- **MD035**: Horizontal rule style (---)
41+
- **MD037**: Spaces inside emphasis markers
42+
- **MD038**: Spaces inside code span elements
43+
- **MD039**: Spaces inside link text
44+
- **MD042**: No empty links
45+
- **MD045**: Images should have alternate text (alt text)
46+
- **MD046**: Code block style (fenced)
47+
- **MD047**: Files should end with a single newline character
48+
- **MD048**: Code fence style (backtick)
49+
- **MD049**: Emphasis style (underscore)
50+
- **MD050**: Strong style (asterisk)
51+
52+
### Disabled Rules
53+
- **MD013**: Line length (disabled for technical docs with long URLs/code)
54+
- **MD033**: Inline HTML (allowed for component demos)
55+
- **MD034**: Bare URLs (allowed as we use many reference links)
56+
- **MD036**: Emphasis used instead of heading (allowed for styling)
57+
- **MD040**: Fenced code blocks should have a language specified (would be noisy)
58+
- **MD041**: First line in a file should be a top-level heading (not always applicable)
59+
- **MD043**: Required heading structure (too restrictive)
60+
- **MD044**: Proper names should have the correct capitalization (would require extensive config)
61+
62+
## Usage
63+
64+
### Run linting on all component docs
65+
```bash
66+
npx markdownlint "en/components/**/*.md"
67+
```
68+
69+
### Run linting on specific file
70+
```bash
71+
npx markdownlint en/components/grid/grid.md
72+
```
73+
74+
### Fix auto-fixable issues
75+
```bash
76+
npx markdownlint --fix "en/components/**/*.md"
77+
```
78+
79+
### Run with custom config
80+
```bash
81+
npx markdownlint --config .markdownlint.json "en/components/**/*.md"
82+
```
83+
84+
## Common Issues and Fixes
85+
86+
### MD001 - Heading increment
87+
**Issue**: Jumping from `##` to `####`
88+
**Fix**: Use `###` instead
89+
90+
### MD009 - Trailing spaces
91+
**Issue**: Unnecessary trailing spaces at end of line
92+
**Fix**: Remove trailing spaces (except when intentional for line breaks)
93+
94+
### MD022 - Headings surrounded by blank lines
95+
**Issue**: No blank line before/after heading
96+
**Fix**: Add blank lines around headings
97+
98+
### MD031 - Code blocks surrounded by blank lines
99+
**Issue**: No blank line before/after code fence
100+
**Fix**: Add blank lines around code blocks
101+
102+
### MD047 - File should end with newline
103+
**Issue**: No newline at end of file
104+
**Fix**: Add single newline at end of file
105+
106+
## Integration with CI/CD
107+
108+
Add to package.json scripts:
109+
```json
110+
{
111+
"scripts": {
112+
"lint:md": "markdownlint 'en/components/**/*.md'",
113+
"lint:md:fix": "markdownlint --fix 'en/components/**/*.md'"
114+
}
115+
}
116+
```
117+
118+
## VS Code Integration
119+
120+
Install the "markdownlint" extension by David Anson for real-time linting in VS Code:
121+
- Extension ID: `DavidAnson.vscode-markdownlint`
122+
- The `.markdownlint.json` file will be automatically detected
123+
124+
## Related Tools
125+
126+
- **cspell**: Spell checking (configured in `cspell.json`)
127+
- **prettier**: Code formatting (if configured)
128+
- **remark-lint**: Alternative markdown linter with different rule set

.markdownlint.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"default": true,
3+
"MD001": true,
4+
"MD003": { "style": "atx" },
5+
"MD004": { "style": "dash" },
6+
"MD007": { "indent": 2 },
7+
"MD009": { "br_spaces": 2 },
8+
"MD010": true,
9+
"MD012": { "maximum": 4 },
10+
"MD013": false,
11+
"MD014": true,
12+
"MD018": true,
13+
"MD019": true,
14+
"MD022": false,
15+
"MD023": true,
16+
"MD024": false,
17+
"MD025": { "front_matter_title": "" },
18+
"MD026": { "punctuation": ".,;:" },
19+
"MD027": true,
20+
"MD028": false,
21+
"MD029": { "style": "ordered" },
22+
"MD030": true,
23+
"MD031": true,
24+
"MD032": false,
25+
"MD033": false,
26+
"MD034": false,
27+
"MD035": { "style": "---" },
28+
"MD036": false,
29+
"MD037": true,
30+
"MD038": true,
31+
"MD039": true,
32+
"MD040": false,
33+
"MD041": false,
34+
"MD042": true,
35+
"MD043": false,
36+
"MD044": false,
37+
"MD045": true,
38+
"MD046": { "style": "fenced" },
39+
"MD047": false,
40+
"MD048": { "style": "backtick" },
41+
"MD049": { "style": "underscore" },
42+
"MD050": { "style": "asterisk" },
43+
"MD051": false,
44+
"MD055": false,
45+
"MD058": true,
46+
"MD059": false
47+
}

0 commit comments

Comments
 (0)