MCPcopy
hub / github.com/PatrickJS/awesome-cursorrules / checkRuleLinks

Function checkRuleLinks

scripts/check-awesome-list.mjs:157–174  ·  view source on GitHub ↗
(readme)

Source from the content-addressed store, hash-verified

155}
156
157function checkRuleLinks(readme) {
158 if (/\]\((\.\/)?rules\//.test(readme)) {
159 failures.push("README rule links must use canonical GitHub URLs so external awesome-list tooling can resolve them.");
160 }
161
162 for (const link of extractMarkdownLinks(readme)) {
163 const target = link.split("#")[0].trim();
164 if (!target) continue;
165
166 const localTarget = toLocalTarget(target);
167 if (localTarget === null) continue;
168
169 const resolved = resolve(root, localTarget);
170 if (!existsSync(resolved)) {
171 failures.push(`README local link is missing: ${target}`);
172 }
173 }
174}
175
176function extractMarkdownLinks(text) {
177 const links = [];

Callers 1

checkReadmeFunction · 0.85

Calls 2

toLocalTargetFunction · 0.85
extractMarkdownLinksFunction · 0.70

Tested by

no test coverage detected