From 8f91b281c7c91f83bb443936a3f90f94d39514a1 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 24 Oct 2023 12:55:06 +0200 Subject: [PATCH] scripts/verify-links: verify links in changesets Signed-off-by: Patrik Oldsberg --- scripts/verify-links.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/verify-links.js b/scripts/verify-links.js index 7664cadad5..b05dd5eead 100755 --- a/scripts/verify-links.js +++ b/scripts/verify-links.js @@ -77,6 +77,10 @@ async function verifyUrl(basePath, absUrl, docPages) { return undefined; } + if (basePath.startsWith('.changeset/')) { + return { url, basePath, problem: 'out-of-changeset' }; + } + let path = ''; if (url.startsWith('/')) { @@ -195,6 +199,10 @@ async function main() { '', )}`, ); + } else if (problem === 'out-of-changeset') { + console.error('Links in changesets must use absolute URLs'); + console.error(` From: ${basePath}`); + console.error(` To: ${url}`); } else if (problem === 'doc-missing') { const suggestion = docPages.get(url) ||