Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Add check for broken links - #312

Open
Jack Bates (jablko) wants to merge 2 commits into
microsoft:masterfrom
jablko:patch-4
Open

Add check for broken links#312
Jack Bates (jablko) wants to merge 2 commits into
microsoft:masterfrom
jablko:patch-4

Conversation

@jablko

Copy link
Copy Markdown
Contributor

The list of dead links was harvested with the following:

git grep -h '^// \(Project\|Definitions\): ' 'types/*/index.d.ts' |
  sed '
    s/\r$//
    s%^// \(Project\|Definitions\): %%
    s/, /\n/g
  ' |
  sort --unique |
  while read -r url; do
    curl --fail --insecure --silent --url "$url" > /dev/null || echo "$url"
  done > broken-links.txt

A similar check was previously removed from dts-critic because it wasn't that useful. This one differs in that it only applies to unresolvable links. It's caught some typos, as well as link rot.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I'm not sure I understand the intent. Is the broken-link error limited to the known list in broken-links.txt? Why not just fix those links then?
  2. The did-you-mean-homepage error seems to behave the same as the former dts-critic error. Is that true? Won't it still break continually as random packages update their homepages on npm?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants