Skip to content

Commit

Permalink
fix: related -> relative
Browse files Browse the repository at this point in the history
  • Loading branch information
Joaquin Montes committed Sep 26, 2023
1 parent c89e228 commit e5b9cb8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/actions/validate-docs-links/lib/index.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions .github/actions/validate-docs-links/src/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const GithubSlugger = require('github-slugger')
import type { Node, Data } from 'unist'
/**
* This script validates internal links in /docs including internal,
* hash, source and related links. It does not validate external links.
* hash, source and relative links. It does not validate external links.
* 1. Collects all .mdx files.
* 2. For each file, it extracts the content, metadata, and heading slugs.
* 3. It creates a document map to efficiently lookup documents by path.
Expand Down Expand Up @@ -39,7 +39,7 @@ interface Errors {
link: string[]
hash: string[]
source: string[]
related: string[]
relative: string[]
}

type ErrorType = Exclude<keyof Errors, 'doc'>
Expand Down Expand Up @@ -202,7 +202,7 @@ function traverseTreeAndValidateLinks(tree: any, doc: Document, setFailed: Failu
link: [],
hash: [],
source: [],
related: [],
relative: [],
}

// Matches markdown links like [text](link)
Expand All @@ -226,7 +226,7 @@ function traverseTreeAndValidateLinks(tree: any, doc: Document, setFailed: Failu
} else if (href.startsWith('#')) {
validateHashLink(errors, href, doc)
} else if (!nonInternalLinkRegex.test(href)) {
errors.related.push(href)
errors.relative.push(href)
}
}
}
Expand Down Expand Up @@ -275,7 +275,7 @@ export async function validateAllInternalLinks(basePath: string, setFailed: Fail
link: [],
hash: [],
source: [],
related: [],
relative: [],
} as Errors
}
})
Expand All @@ -286,7 +286,7 @@ export async function validateAllInternalLinks(basePath: string, setFailed: Fail

let errorRows: string[] = []

const errorTypes: ErrorType[] = ['link', 'hash', 'source', 'related']
const errorTypes: ErrorType[] = ['link', 'hash', 'source', 'relative']
allErrors.forEach((errors) => {
const {
doc: { path: docPath },
Expand Down

0 comments on commit e5b9cb8

Please sign in to comment.