-
Notifications
You must be signed in to change notification settings - Fork 845
Expand file tree
/
Copy pathmarkdownlint.mdc
More file actions
49 lines (35 loc) · 1.37 KB
/
markdownlint.mdc
File metadata and controls
49 lines (35 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
globs: "**/*.md,**/*.mdc"
alwaysApply: true
version: "1.3.0"
---
# Markdownlint Auto-Fix Rules
## Automatic Markdownlint Application
When creating or updating any Markdown or MDC document (`.md` and `.mdc` files), you MUST:
1. **After creating a new file**: Automatically run markdownlint with auto-fix to ensure the
file follows best practices
2. **After updating an existing file**: Automatically run markdownlint with auto-fix to correct
any linting issues introduced
## Implementation
Run via `npx` — no `package.json` or local install required:
```bash
npx markdownlint-cli2 --fix <file>
```
Lint configuration is in `.markdownlint.json` at the repo root (120-char line limit, tables
exempt, consistent table-pipe style).
## Workflow
1. Create or edit the `.md` or `.mdc` file
2. Run `npx markdownlint-cli2 --fix <file>` to auto-fix issues
3. Review the changes and ensure they don't alter the document's meaning
4. If markdownlint reports unfixable issues, inform the user about them
## Example Commands
```bash
# Fix a single file
npx markdownlint-cli2 --fix path/to/file.md
# Fix a Cursor/AI rule file
npx markdownlint-cli2 --fix ai/rules/some-rule.mdc
# Fix all markdown and mdc files (excluding node_modules)
npx markdownlint-cli2 --fix "**/*.md" "**/*.mdc" "#node_modules"
# Fix multiple specific files
npx markdownlint-cli2 --fix file1.md file2.mdc file3.md
```