@dougis/markdown-lint-mcp 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/CONTRIBUTING.md +474 -0
  3. package/LICENSE +21 -0
  4. package/README.md +240 -0
  5. package/USAGE.md +40 -0
  6. package/dist/index.d.ts +3 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +39 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/rules/index.d.ts +22 -0
  11. package/dist/rules/index.d.ts.map +1 -0
  12. package/dist/rules/index.js +144 -0
  13. package/dist/rules/index.js.map +1 -0
  14. package/dist/rules/md001.d.ts +25 -0
  15. package/dist/rules/md001.d.ts.map +1 -0
  16. package/dist/rules/md001.js +79 -0
  17. package/dist/rules/md001.js.map +1 -0
  18. package/dist/rules/md003.d.ts +41 -0
  19. package/dist/rules/md003.d.ts.map +1 -0
  20. package/dist/rules/md003.js +130 -0
  21. package/dist/rules/md003.js.map +1 -0
  22. package/dist/rules/md004.d.ts +28 -0
  23. package/dist/rules/md004.d.ts.map +1 -0
  24. package/dist/rules/md004.js +79 -0
  25. package/dist/rules/md004.js.map +1 -0
  26. package/dist/rules/md005.d.ts +21 -0
  27. package/dist/rules/md005.d.ts.map +1 -0
  28. package/dist/rules/md005.js +88 -0
  29. package/dist/rules/md005.js.map +1 -0
  30. package/dist/rules/md007.d.ts +21 -0
  31. package/dist/rules/md007.d.ts.map +1 -0
  32. package/dist/rules/md007.js +66 -0
  33. package/dist/rules/md007.js.map +1 -0
  34. package/dist/rules/md009.d.ts +35 -0
  35. package/dist/rules/md009.d.ts.map +1 -0
  36. package/dist/rules/md009.js +122 -0
  37. package/dist/rules/md009.js.map +1 -0
  38. package/dist/rules/md010.d.ts +34 -0
  39. package/dist/rules/md010.d.ts.map +1 -0
  40. package/dist/rules/md010.js +75 -0
  41. package/dist/rules/md010.js.map +1 -0
  42. package/dist/rules/md011.d.ts +30 -0
  43. package/dist/rules/md011.d.ts.map +1 -0
  44. package/dist/rules/md011.js +123 -0
  45. package/dist/rules/md011.js.map +1 -0
  46. package/dist/rules/md012.d.ts +33 -0
  47. package/dist/rules/md012.d.ts.map +1 -0
  48. package/dist/rules/md012.js +125 -0
  49. package/dist/rules/md012.js.map +1 -0
  50. package/dist/rules/md013.d.ts +26 -0
  51. package/dist/rules/md013.d.ts.map +1 -0
  52. package/dist/rules/md013.js +32 -0
  53. package/dist/rules/md013.js.map +1 -0
  54. package/dist/rules/md014.d.ts +29 -0
  55. package/dist/rules/md014.d.ts.map +1 -0
  56. package/dist/rules/md014.js +176 -0
  57. package/dist/rules/md014.js.map +1 -0
  58. package/dist/rules/md018.d.ts +22 -0
  59. package/dist/rules/md018.d.ts.map +1 -0
  60. package/dist/rules/md018.js +27 -0
  61. package/dist/rules/md018.js.map +1 -0
  62. package/dist/rules/md019.d.ts +22 -0
  63. package/dist/rules/md019.d.ts.map +1 -0
  64. package/dist/rules/md019.js +27 -0
  65. package/dist/rules/md019.js.map +1 -0
  66. package/dist/rules/md020.d.ts +22 -0
  67. package/dist/rules/md020.d.ts.map +1 -0
  68. package/dist/rules/md020.js +27 -0
  69. package/dist/rules/md020.js.map +1 -0
  70. package/dist/rules/md021.d.ts +22 -0
  71. package/dist/rules/md021.d.ts.map +1 -0
  72. package/dist/rules/md021.js +27 -0
  73. package/dist/rules/md021.js.map +1 -0
  74. package/dist/rules/md022.d.ts +21 -0
  75. package/dist/rules/md022.d.ts.map +1 -0
  76. package/dist/rules/md022.js +43 -0
  77. package/dist/rules/md022.js.map +1 -0
  78. package/dist/rules/md023.d.ts +21 -0
  79. package/dist/rules/md023.d.ts.map +1 -0
  80. package/dist/rules/md023.js +34 -0
  81. package/dist/rules/md023.js.map +1 -0
  82. package/dist/rules/md024.d.ts +30 -0
  83. package/dist/rules/md024.d.ts.map +1 -0
  84. package/dist/rules/md024.js +123 -0
  85. package/dist/rules/md024.js.map +1 -0
  86. package/dist/rules/md025.d.ts +34 -0
  87. package/dist/rules/md025.d.ts.map +1 -0
  88. package/dist/rules/md025.js +134 -0
  89. package/dist/rules/md025.js.map +1 -0
  90. package/dist/rules/md026.d.ts +21 -0
  91. package/dist/rules/md026.d.ts.map +1 -0
  92. package/dist/rules/md026.js +31 -0
  93. package/dist/rules/md026.js.map +1 -0
  94. package/dist/rules/md027.d.ts +22 -0
  95. package/dist/rules/md027.d.ts.map +1 -0
  96. package/dist/rules/md027.js +27 -0
  97. package/dist/rules/md027.js.map +1 -0
  98. package/dist/rules/md028.d.ts +37 -0
  99. package/dist/rules/md028.d.ts.map +1 -0
  100. package/dist/rules/md028.js +84 -0
  101. package/dist/rules/md028.js.map +1 -0
  102. package/dist/rules/md029.d.ts +30 -0
  103. package/dist/rules/md029.d.ts.map +1 -0
  104. package/dist/rules/md029.js +36 -0
  105. package/dist/rules/md029.js.map +1 -0
  106. package/dist/rules/md030.d.ts +28 -0
  107. package/dist/rules/md030.d.ts.map +1 -0
  108. package/dist/rules/md030.js +76 -0
  109. package/dist/rules/md030.js.map +1 -0
  110. package/dist/rules/md031.d.ts +22 -0
  111. package/dist/rules/md031.d.ts.map +1 -0
  112. package/dist/rules/md031.js +55 -0
  113. package/dist/rules/md031.js.map +1 -0
  114. package/dist/rules/md032.d.ts +21 -0
  115. package/dist/rules/md032.d.ts.map +1 -0
  116. package/dist/rules/md032.js +69 -0
  117. package/dist/rules/md032.js.map +1 -0
  118. package/dist/rules/md033.d.ts +28 -0
  119. package/dist/rules/md033.d.ts.map +1 -0
  120. package/dist/rules/md033.js +34 -0
  121. package/dist/rules/md033.js.map +1 -0
  122. package/dist/rules/md034.d.ts +28 -0
  123. package/dist/rules/md034.d.ts.map +1 -0
  124. package/dist/rules/md034.js +100 -0
  125. package/dist/rules/md034.js.map +1 -0
  126. package/dist/rules/md035.d.ts +23 -0
  127. package/dist/rules/md035.d.ts.map +1 -0
  128. package/dist/rules/md035.js +52 -0
  129. package/dist/rules/md035.js.map +1 -0
  130. package/dist/rules/md036.d.ts +34 -0
  131. package/dist/rules/md036.d.ts.map +1 -0
  132. package/dist/rules/md036.js +112 -0
  133. package/dist/rules/md036.js.map +1 -0
  134. package/dist/rules/md037.d.ts +28 -0
  135. package/dist/rules/md037.d.ts.map +1 -0
  136. package/dist/rules/md037.js +122 -0
  137. package/dist/rules/md037.js.map +1 -0
  138. package/dist/rules/md038.d.ts +28 -0
  139. package/dist/rules/md038.d.ts.map +1 -0
  140. package/dist/rules/md038.js +62 -0
  141. package/dist/rules/md038.js.map +1 -0
  142. package/dist/rules/md039.d.ts +21 -0
  143. package/dist/rules/md039.d.ts.map +1 -0
  144. package/dist/rules/md039.js +34 -0
  145. package/dist/rules/md039.js.map +1 -0
  146. package/dist/rules/md040.d.ts +21 -0
  147. package/dist/rules/md040.d.ts.map +1 -0
  148. package/dist/rules/md040.js +46 -0
  149. package/dist/rules/md040.js.map +1 -0
  150. package/dist/rules/md041.d.ts +33 -0
  151. package/dist/rules/md041.d.ts.map +1 -0
  152. package/dist/rules/md041.js +92 -0
  153. package/dist/rules/md041.js.map +1 -0
  154. package/dist/rules/md042.d.ts +22 -0
  155. package/dist/rules/md042.d.ts.map +1 -0
  156. package/dist/rules/md042.js +50 -0
  157. package/dist/rules/md042.js.map +1 -0
  158. package/dist/rules/md043.d.ts +39 -0
  159. package/dist/rules/md043.d.ts.map +1 -0
  160. package/dist/rules/md043.js +116 -0
  161. package/dist/rules/md043.js.map +1 -0
  162. package/dist/rules/md044.d.ts +40 -0
  163. package/dist/rules/md044.d.ts.map +1 -0
  164. package/dist/rules/md044.js +167 -0
  165. package/dist/rules/md044.js.map +1 -0
  166. package/dist/rules/md045.d.ts +22 -0
  167. package/dist/rules/md045.d.ts.map +1 -0
  168. package/dist/rules/md045.js +57 -0
  169. package/dist/rules/md045.js.map +1 -0
  170. package/dist/rules/md046.d.ts +23 -0
  171. package/dist/rules/md046.d.ts.map +1 -0
  172. package/dist/rules/md046.js +174 -0
  173. package/dist/rules/md046.js.map +1 -0
  174. package/dist/rules/md047.d.ts +22 -0
  175. package/dist/rules/md047.d.ts.map +1 -0
  176. package/dist/rules/md047.js +35 -0
  177. package/dist/rules/md047.js.map +1 -0
  178. package/dist/rules/md048.d.ts +22 -0
  179. package/dist/rules/md048.d.ts.map +1 -0
  180. package/dist/rules/md048.js +80 -0
  181. package/dist/rules/md048.js.map +1 -0
  182. package/dist/rules/md049.d.ts +33 -0
  183. package/dist/rules/md049.d.ts.map +1 -0
  184. package/dist/rules/md049.js +189 -0
  185. package/dist/rules/md049.js.map +1 -0
  186. package/dist/rules/md050.d.ts +22 -0
  187. package/dist/rules/md050.d.ts.map +1 -0
  188. package/dist/rules/md050.js +32 -0
  189. package/dist/rules/md050.js.map +1 -0
  190. package/dist/rules/md051.d.ts +23 -0
  191. package/dist/rules/md051.d.ts.map +1 -0
  192. package/dist/rules/md051.js +63 -0
  193. package/dist/rules/md051.js.map +1 -0
  194. package/dist/rules/md052.d.ts +21 -0
  195. package/dist/rules/md052.d.ts.map +1 -0
  196. package/dist/rules/md052.js +71 -0
  197. package/dist/rules/md052.js.map +1 -0
  198. package/dist/rules/md053.d.ts +21 -0
  199. package/dist/rules/md053.d.ts.map +1 -0
  200. package/dist/rules/md053.js +95 -0
  201. package/dist/rules/md053.js.map +1 -0
  202. package/dist/rules/md054.d.ts +21 -0
  203. package/dist/rules/md054.d.ts.map +1 -0
  204. package/dist/rules/md054.js +87 -0
  205. package/dist/rules/md054.js.map +1 -0
  206. package/dist/rules/md055.d.ts +22 -0
  207. package/dist/rules/md055.d.ts.map +1 -0
  208. package/dist/rules/md055.js +157 -0
  209. package/dist/rules/md055.js.map +1 -0
  210. package/dist/rules/md056.d.ts +21 -0
  211. package/dist/rules/md056.d.ts.map +1 -0
  212. package/dist/rules/md056.js +154 -0
  213. package/dist/rules/md056.js.map +1 -0
  214. package/dist/rules/md058.d.ts +27 -0
  215. package/dist/rules/md058.d.ts.map +1 -0
  216. package/dist/rules/md058.js +71 -0
  217. package/dist/rules/md058.js.map +1 -0
  218. package/dist/rules/md059.d.ts +22 -0
  219. package/dist/rules/md059.d.ts.map +1 -0
  220. package/dist/rules/md059.js +161 -0
  221. package/dist/rules/md059.js.map +1 -0
  222. package/dist/rules/rule-interface.d.ts +51 -0
  223. package/dist/rules/rule-interface.d.ts.map +1 -0
  224. package/dist/rules/rule-interface.js +2 -0
  225. package/dist/rules/rule-interface.js.map +1 -0
  226. package/dist/server.d.ts +59 -0
  227. package/dist/server.d.ts.map +1 -0
  228. package/dist/server.js +419 -0
  229. package/dist/server.js.map +1 -0
  230. package/dist/types.d.ts +74 -0
  231. package/dist/types.d.ts.map +1 -0
  232. package/dist/types.js +14 -0
  233. package/dist/types.js.map +1 -0
  234. package/dist/utils/file.d.ts +39 -0
  235. package/dist/utils/file.d.ts.map +1 -0
  236. package/dist/utils/file.js +124 -0
  237. package/dist/utils/file.js.map +1 -0
  238. package/dist/utils/logger.d.ts +61 -0
  239. package/dist/utils/logger.d.ts.map +1 -0
  240. package/dist/utils/logger.js +85 -0
  241. package/dist/utils/logger.js.map +1 -0
  242. package/dist/utils/safe-match.d.ts +4 -0
  243. package/dist/utils/safe-match.d.ts.map +1 -0
  244. package/dist/utils/safe-match.js +51 -0
  245. package/dist/utils/safe-match.js.map +1 -0
  246. package/package.json +85 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,80 @@
1
+ # Changelog
2
+
3
+ All notable changes to the markdownlint-mcp project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Changed
11
+ - **Node.js Minimum Version**: Increased minimum required version from 16.0.0 to 20.0.0
12
+ - Updated to support only current and maintained LTS versions
13
+ - Updated engines in package.json to reflect this requirement
14
+ - **CI/CD Pipeline Updates**:
15
+ - Test matrix now includes: Node.js 20.x (Iron), 22.x (Jod), 24.x (Krypton), and 25.x (Current)
16
+ - Updated GitHub Actions: `actions/checkout@v4`, `actions/setup-node@v4`, `codecov/codecov-action@v4`
17
+ - Coverage reports now uploaded for Node.js 25.x (latest version) instead of 24.x
18
+ - NPM publish job now uses Node.js 24.x LTS (latest stable) for releases
19
+ - **Documentation Updates**:
20
+ - Enhanced CONTRIBUTING.md with comprehensive installation and setup instructions
21
+ - Added detailed breakdown of all production and development dependencies
22
+ - Updated all version requirements throughout documentation to match new minimum requirements
23
+ - Added explicit npm version requirement (7.0.0+) to both package.json and documentation
24
+ - Enhanced dependencies documentation with which npm scripts use each tool
25
+ - **Dependency Version Updates** - Updated all packages to latest stable versions:
26
+ - `@modelcontextprotocol/sdk`: ^1.0.0 → ^1.25.0
27
+ - `markdownlint`: ^0.34.0 → ^0.40.0
28
+ - `typescript`: ^5.0.0 → ^5.9.0
29
+ - `jest`: ^29.5.0 → ^30.2.0
30
+ - `@jest/globals`: ^30.0.3 → ^30.2.0
31
+ - `@types/jest`: ^29.5.0 → ^30.0.0
32
+ - `@types/node`: ^20.0.0 → ^25.0.0
33
+ - `eslint`: ^8.40.0 → ^9.0.0
34
+ - `@typescript-eslint/eslint-plugin`: ^6.0.0 → ^8.53.0
35
+ - `@typescript-eslint/parser`: ^6.0.0 → ^8.53.0
36
+ - `eslint-config-prettier`: ^9.0.0 → ^10.0.0
37
+ - `eslint-plugin-jest`: ^27.2.0 → ^29.12.0
38
+ - `eslint-plugin-prettier`: ^5.0.0 → ^5.5.0
39
+ - `prettier`: ^3.0.0 → ^3.7.0
40
+ - `ts-jest`: ^29.1.0 → ^29.4.0
41
+ - **package.json**:
42
+ - Added explicit npm engine requirement: `npm >= 7.0.0`
43
+ - Updated all dependency versions to latest stable releases
44
+
45
+ ### Added
46
+ - Comprehensive CONTRIBUTING.md with:
47
+ - Complete system requirements documentation
48
+ - Step-by-step installation guide
49
+ - Detailed project structure overview
50
+ - Development workflow instructions
51
+ - Code quality standards and best practices
52
+ - Testing guidelines and coverage requirements
53
+ - CI/CD pipeline documentation
54
+ - Troubleshooting section with common issues and solutions
55
+ - Links to relevant resources
56
+ - Documentation of which npm scripts use each development tool
57
+
58
+ ### Planned
59
+ - Testing framework with Jest
60
+ - Enhanced project structure
61
+ - ESLint and Prettier configuration
62
+ - GitHub Actions CI/CD pipeline
63
+ - Enhanced documentation
64
+ - Improved error handling
65
+ - Performance optimizations
66
+
67
+ ## [1.0.0] - Initial Release
68
+
69
+ ### Added
70
+ - Basic MCP server implementation
71
+ - Integration with markdownlint library
72
+ - Three MCP tools:
73
+ - `lint_markdown`: Analyze Markdown files for issues
74
+ - `fix_markdown`: Automatically fix Markdown issues
75
+ - `get_configuration`: Display current linting rules
76
+ - Custom fix implementations for common Markdown issues
77
+ - Configuration support via .markdownlint.json
78
+ - Basic error handling
79
+ - README.md with project overview
80
+ - USAGE.md with basic usage instructions
@@ -0,0 +1,474 @@
1
+ # Contributing to markdownlint-mcp
2
+
3
+ Thank you for your interest in contributing to this project! This comprehensive guide will help you get started with development, testing, and contribution workflows.
4
+
5
+ ## Table of Contents
6
+
7
+ - [System Requirements](#system-requirements)
8
+ - [Installation & Setup](#installation--setup)
9
+ - [Development Workflow](#development-workflow)
10
+ - [Code Quality Standards](#code-quality-standards)
11
+ - [Testing](#testing)
12
+ - [Before You Submit](#before-you-submit)
13
+ - [Pull Request Process](#pull-request-process)
14
+ - [Issue Reporting](#issue-reporting)
15
+ - [License](#license)
16
+
17
+ ---
18
+
19
+ ## System Requirements
20
+
21
+ ### Required Software
22
+
23
+ - **Node.js**: Version 20.0.0 or higher (LTS recommended)
24
+ - Officially tested on: Node.js 20.x and 22.x (LTS)
25
+ - Newer Node.js versions (e.g., 24.x, 25.x) may work but are not guaranteed in CI
26
+ - Verify with: `node --version`
27
+ - Installation: https://nodejs.org/
28
+
29
+ - **npm**: Version 7.0.0 or higher (comes with Node.js)
30
+ - Verify with: `npm --version`
31
+
32
+ ### Supported Node.js Versions
33
+
34
+ The project is officially tested and supported on:
35
+ - Node.js 20.x (LTS)
36
+ - Node.js 22.x (LTS)
37
+
38
+ Note: Node.js 24.x and 25.x may work, but they are not part of the official CI matrix and may have incompatibilities.
39
+
40
+ ### Optional Tools
41
+
42
+ - **Git**: For version control (required for cloning and contributing)
43
+ - Verify with: `git --version`
44
+ - Installation: https://git-scm.com/
45
+ - **VS Code** or preferred code editor (recommended for development)
46
+
47
+ ---
48
+
49
+ ## Installation & Setup
50
+
51
+ ### Step 1: Fork and Clone the Repository
52
+
53
+ ```bash
54
+ # Fork on GitHub (visit https://github.com/ernestgwilsonii/markdownlint-mcp)
55
+ # Then clone your fork
56
+ # Use the clone URL shown on your fork's GitHub page (replace YOUR-USERNAME and repo name if you renamed it):
57
+ git clone https://github.com/YOUR-USERNAME/markdownlint-mcp.git
58
+ cd markdownlint-mcp
59
+
60
+ # Add upstream remote to stay synchronized
61
+ git remote add upstream https://github.com/ernestgwilsonii/markdownlint-mcp.git
62
+ ```
63
+
64
+ ### Step 2: Install All Dependencies
65
+
66
+ ```bash
67
+ npm install
68
+ ```
69
+
70
+ This command automatically installs all required tools. Running `npm install` will install both production and development dependencies specified in `package.json`. All tools needed for npm scripts are included and will be installed automatically.
71
+
72
+ **Production Dependencies:**
73
+ - `@modelcontextprotocol/sdk@^1.25.0` - Model Context Protocol SDK for building MCP servers
74
+ - `markdownlint@^0.40.0` - Core markdown linting engine
75
+
76
+ **Development Dependencies (Automatically Installed):**
77
+ - `typescript@^5.9.0` - TypeScript compiler for strict type checking
78
+ - Used by: `npm run build`, `npm run dev`
79
+ - `ts-jest@^29.4.0` - Jest preset for TypeScript support
80
+ - Used by: `npm test`, `npm run test:watch`, `npm run test:coverage`
81
+ - `jest@^30.2.0` - Testing framework
82
+ - Used by: `npm test`, `npm run test:watch`, `npm run test:coverage`
83
+ - `@jest/globals@^30.2.0` - Jest global types
84
+ - Used by: jest tests
85
+ - `@types/jest@^30.0.0` - Jest type definitions
86
+ - Used by: jest tests
87
+ - `@types/node@^25.0.0` - Node.js API types
88
+ - Used by: TypeScript compilation
89
+ - `eslint@^9.0.0` - Code linting tool
90
+ - Used by: `npm run lint`, `npm run lint:fix`
91
+ - `@typescript-eslint/eslint-plugin@^8.53.0` - TypeScript linting rules
92
+ - Used by: `npm run lint`, `npm run lint:fix`
93
+ - `@typescript-eslint/parser@^8.53.0` - TypeScript parser for ESLint
94
+ - Used by: `npm run lint`, `npm run lint:fix`
95
+ - `eslint-config-prettier@^10.0.0` - Prettier integration for ESLint
96
+ - Used by: `npm run lint`, `npm run lint:fix`
97
+ - `eslint-plugin-prettier@^5.5.0` - ESLint plugin for Prettier formatting
98
+ - Used by: `npm run lint`, `npm run lint:fix`
99
+ - `eslint-plugin-jest@^29.12.0` - ESLint plugin for Jest best practices
100
+ - Used by: `npm run lint`, `npm run lint:fix`
101
+ - `prettier@^3.7.0` - Code formatter
102
+ - Used by: `npm run format`
103
+
104
+ All these tools are installed automatically when you run `npm install` - no additional installation steps are needed.
105
+
106
+ ### Step 3: Verify Installation
107
+
108
+ Test that everything is working:
109
+
110
+ ```bash
111
+ npm run build # Compiles TypeScript to dist/
112
+ npm test # Runs full test suite
113
+ npm run lint # Checks code quality with ESLint
114
+ ```
115
+
116
+ All three commands should complete successfully without errors.
117
+
118
+ ---
119
+
120
+ ## Development Workflow
121
+
122
+ ### Project Structure
123
+
124
+ ```
125
+ markdownlint-mcp/
126
+ ├── src/ # TypeScript source code
127
+ │ ├── index.ts # Main MCP server entry point
128
+ │ ├── tools/ # MCP tool implementations
129
+ │ │ ├── lintMarkdown.ts
130
+ │ │ ├── fixMarkdown.ts
131
+ │ │ └── getConfiguration.ts
132
+ │ └── utils/ # Utility modules
133
+ ├── tests/ # Jest test files (*.test.ts)
134
+ ├── dist/ # Compiled JavaScript output (generated)
135
+ ├── .github/
136
+ │ └── workflows/ # GitHub Actions CI/CD
137
+ ├── coverage/ # Test coverage reports (generated)
138
+ ├── node_modules/ # Installed dependencies (generated)
139
+ ├── package.json # Project metadata and dependencies
140
+ ├── package-lock.json # Dependency lock file
141
+ ├── tsconfig.json # TypeScript compiler options
142
+ ├── jest.config.cjs # Jest testing configuration
143
+ ├── eslint.config.cjs # ESLint (flat) configuration
144
+ ├── .prettierrc # Prettier formatting rules
145
+ ├── README.md # User-facing documentation
146
+ └── CONTRIBUTING.md # This file
147
+ ```
148
+
149
+ ### Build & Compilation
150
+
151
+ ```bash
152
+ # TypeScript compilation (one-time)
153
+ npm run build
154
+
155
+ # Clean rebuild
156
+ rm -rf dist && npm run build
157
+ ```
158
+
159
+ Output goes to `dist/` directory as ES modules.
160
+
161
+ ### Running the Server
162
+
163
+ ```bash
164
+ # Start the compiled MCP server
165
+ npm start
166
+
167
+ # Development mode with auto-reload
168
+ npm run dev
169
+ ```
170
+
171
+ ### Code Formatting
172
+
173
+ ```bash
174
+ # Automatically format all code with Prettier
175
+ npm run format
176
+
177
+ # Format specific file
178
+ npx prettier --write src/myfile.ts
179
+
180
+ # Check what would be formatted (without applying)
181
+ npx prettier --check src/
182
+ ```
183
+
184
+ ### Running the Linter
185
+
186
+ ```bash
187
+ # Check for linting issues
188
+ npm run lint
189
+
190
+ # Automatically fix fixable linting issues
191
+ npm run lint:fix
192
+
193
+ # Lint specific file
194
+ npx eslint src/myfile.ts --fix
195
+ ```
196
+
197
+ ---
198
+
199
+ ## Code Quality Standards
200
+
201
+ ### TypeScript Configuration
202
+
203
+ The project uses strict TypeScript settings (`tsconfig.json`):
204
+
205
+ - **Strict mode**: Full type checking enabled
206
+ - **Target**: ES2022 JavaScript standard
207
+ - **Module system**: ESNext with node resolution
208
+ - **Source maps**: Generated for debugging
209
+
210
+ ### ESLint Rules
211
+
212
+ Key linting rules are enforced:
213
+
214
+ - **Code formatting**: Prettier integration mandatory
215
+ - **Console usage**: Only `warn` and `error` are allowed
216
+ - **Type annotations**: Explicit function return types not required, but consider them
217
+ - **Any types**: Warned when used (avoid `any` when possible)
218
+ - **Unused variables**: Error - unused parameters must be prefixed with `_`
219
+ - **Jest best practices**: Tests must be valid and not disabled/focused
220
+
221
+ ### Code Style
222
+
223
+ Prettier formats code with these settings:
224
+
225
+ - **Line width**: 100 characters
226
+ - **Indentation**: 2 spaces
227
+ - **Quotes**: Single quotes for JavaScript
228
+ - **Semicolons**: Required
229
+ - **Trailing commas**: ES5 compatible
230
+ - **Bracket spacing**: `{ foo: bar }`
231
+ - **Arrow functions**: Parentheses avoided where possible
232
+
233
+ ---
234
+
235
+ ## Testing
236
+
237
+ ### Running Tests
238
+
239
+ ```bash
240
+ # Run all tests once
241
+ npm test
242
+
243
+ # Run tests in watch mode (re-runs on file changes)
244
+ npm run test:watch
245
+
246
+ # Generate coverage report
247
+ npm run test:coverage
248
+
249
+ # Run specific test file
250
+ npm test -- path/to/test.test.ts
251
+
252
+ # Run tests matching pattern
253
+ npm test -- --testNamePattern="lint"
254
+ ```
255
+
256
+ ### Test Structure
257
+
258
+ Tests are located in the `tests/` directory with `*.test.ts` naming convention.
259
+
260
+ **Jest Configuration:**
261
+ - **Test environment**: Node.js
262
+ - **Preset**: ts-jest for TypeScript support
263
+ - **Coverage threshold**: Minimum 80% for branches, functions, lines, and statements
264
+
265
+ ### Writing Tests
266
+
267
+ 1. **Follow existing patterns** in `tests/` directory
268
+ 2. **Use descriptive test names**: `describe` blocks and `it()` statements should be clear
269
+ 3. **Test both happy paths and edge cases**
270
+ 4. **Maintain 80%+ coverage** for new code
271
+ 5. **Mock external dependencies** appropriately
272
+
273
+ ### Coverage Requirements
274
+
275
+ - **Minimum 80% coverage** across all metrics
276
+ - Coverage reports generated in `coverage/` directory
277
+ - Check coverage: `npm run test:coverage`
278
+
279
+ ---
280
+
281
+ ## Before You Submit
282
+
283
+ ### Pre-commit Checklist
284
+
285
+ Before pushing or creating a pull request, ensure:
286
+
287
+ ```bash
288
+ # 1. Build compiles without errors
289
+ npm run build
290
+
291
+ # 2. All tests pass
292
+ npm test
293
+
294
+ # 3. No linting errors
295
+ npm run lint
296
+
297
+ # 4. Code is properly formatted
298
+ npm run format
299
+
300
+ # 5. Coverage meets threshold
301
+ npm run test:coverage
302
+ ```
303
+
304
+ Or run all checks at once:
305
+
306
+ ```bash
307
+ npm run prepublishOnly # Runs test and lint
308
+ ```
309
+
310
+ ### Git Workflow
311
+
312
+ 1. **Create a feature branch** from `main`:
313
+ ```bash
314
+ git checkout -b feature/your-feature-name
315
+ ```
316
+
317
+ 2. **Make your changes** with atomic commits:
318
+ ```bash
319
+ git commit -m "feat: descriptive message"
320
+ ```
321
+
322
+ 3. **Push to your fork**:
323
+ ```bash
324
+ git push origin feature/your-feature-name
325
+ ```
326
+
327
+ 4. **Create a Pull Request** with:
328
+ - Clear title describing the change
329
+ - Description of what and why
330
+ - Link to any related issues
331
+ - Evidence that tests pass and coverage maintained
332
+
333
+ ### Commit Message Convention
334
+
335
+ Follow conventional commits for clarity:
336
+
337
+ - `feat:` - New feature
338
+ - `fix:` - Bug fix
339
+ - `docs:` - Documentation only
340
+ - `style:` - Code style/formatting
341
+ - `refactor:` - Code refactoring
342
+ - `perf:` - Performance improvement
343
+ - `test:` - Adding/updating tests
344
+ - `ci:` - CI/CD changes
345
+
346
+ ### Pull Request Requirements
347
+
348
+ Your PR must:
349
+
350
+ - ✅ Pass all CI/CD checks (GitHub Actions)
351
+ - Build succeeds on Node.js 20.x and 22.x (official CI matrix)
352
+ - All tests pass
353
+ - Linting passes
354
+ - ✅ Maintain or improve code coverage (minimum 80%)
355
+ - ✅ Include tests for new functionality
356
+ - ✅ Update documentation if needed
357
+ - ✅ Have a clear, descriptive title and description
358
+ - ✅ Be based on current `main` branch
359
+
360
+ ---
361
+
362
+ ## Pull Request Process
363
+
364
+ 1. Ensure all tests pass and the build is successful
365
+ 2. Update the documentation with details of changes, including new features, APIs, or breaking changes
366
+ 3. The versioning scheme we use is [SemVer](http://semver.org/). The maintainers will handle the version updates
367
+ 4. Your pull request will be reviewed by at least one maintainer
368
+ 5. Once approved, your pull request will be merged by a maintainer
369
+
370
+ ---
371
+
372
+ ## CI/CD Pipeline
373
+
374
+ The project uses GitHub Actions for automated testing and publishing.
375
+
376
+ ### On Pull Request
377
+
378
+ - Tests run on Node.js 20.x and 22.x (official CI matrix). Newer Node.js versions may be tried in separate workflows.
379
+ - Code is linted with ESLint
380
+ - Coverage reports uploaded to Codecov on the project's designated runner (currently Node.js 22.x)
381
+ - Build artifacts verified
382
+
383
+ ### On Release
384
+
385
+ - Package is automatically published to NPM using a maintained LTS Node.js version (e.g., Node.js 22.x)
386
+ - Requires all tests to pass
387
+ - Triggered when a release is created on GitHub
388
+
389
+ ---
390
+
391
+ ## Troubleshooting
392
+
393
+ ### Build Fails
394
+
395
+ ```bash
396
+ # Clear cache and reinstall
397
+ rm -rf node_modules package-lock.json dist/
398
+ npm install
399
+ npm run build
400
+ ```
401
+
402
+ ### Tests Fail with Type Errors
403
+
404
+ ```bash
405
+ # Ensure TypeScript compilation works
406
+ npx tsc --noEmit
407
+
408
+ # Regenerate types
409
+ npm install
410
+ ```
411
+
412
+ ### Linting Issues Won't Fix
413
+
414
+ ```bash
415
+ # Try ESLint with --fix flag explicitly
416
+ npx eslint src --ext .ts --fix
417
+
418
+ # Then format with Prettier
419
+ npm run format
420
+ ```
421
+
422
+ ### Coverage Below Threshold
423
+
424
+ ```bash
425
+ # Check which files are missing coverage
426
+ npm run test:coverage
427
+
428
+ # Review coverage report
429
+ open coverage/lcov-report/index.html
430
+ ```
431
+
432
+ ---
433
+
434
+ ## Resources
435
+
436
+ - **Model Context Protocol**: https://modelcontextprotocol.io/
437
+ - **markdownlint Rules**: https://github.com/DavidAnson/markdownlint/blob/main/README.md#rules
438
+ - **TypeScript Handbook**: https://www.typescriptlang.org/docs/
439
+ - **Jest Documentation**: https://jestjs.io/docs/getting-started
440
+ - **ESLint Guide**: https://eslint.org/docs/rules/
441
+
442
+ ---
443
+
444
+ ## Issue Reporting
445
+
446
+ ### Bug Reports
447
+
448
+ When reporting bugs, please include:
449
+
450
+ 1. A clear and descriptive title
451
+ 2. Steps to reproduce the issue
452
+ 3. Expected behavior
453
+ 4. Actual behavior
454
+ 5. Environment information (OS, Node.js version, etc.)
455
+ 6. Any relevant logs or error messages
456
+
457
+ ### Feature Requests
458
+
459
+ For feature requests, please include:
460
+
461
+ 1. A clear and descriptive title
462
+ 2. A detailed description of the proposed feature
463
+ 3. Any relevant examples or use cases
464
+ 4. An explanation of why this feature would be valuable
465
+
466
+ ---
467
+
468
+ ## License
469
+
470
+ By contributing to this project, you agree that your contributions will be licensed under the same [MIT License](LICENSE) that covers the project.
471
+
472
+ ---
473
+
474
+ Thank you for contributing to markdownlint-mcp! 🎉
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Ernest G. Wilson II
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.