1
0
mirror of synced 2025-12-23 03:44:00 -05:00

LinkChecker and better linksToSkip function (#23001)

* LinkChecker and better linksToSkip function

Part of #1253

* try now

* escaped

* make sure it skips all non-english links

* feedbacked
This commit is contained in:
Peter Bengtsson
2021-11-30 16:39:39 -05:00
committed by GitHub
parent e59c79acd0
commit 2f6f076cc0
3 changed files with 33 additions and 10 deletions

View File

@@ -1,18 +1,28 @@
// Linkinator treats the following as regex.
/**
* This file exports a mix of strings and of regexes. Linkinator relies
* on this in `script/check-english-links.js` when we encounter external
* links that we *specifically ignore*. That means, that URLs or patterns
* mentioned in this file might appear within our content but we don't
* bother checking that they actually work.
*/
/* eslint-disable prefer-regex-literals */
export default [
// Skip GitHub search links.
'https://github.com/search\\?',
'https://github.com/github/gitignore/search\\?',
// E.g. https://github.com/search?foo=bar
new RegExp('https://github\\.com/search\\?'),
new RegExp('https://github\\.com/github/gitignore/search\\?'),
// These links require auth.
'https://github.com/settings/profile',
'https://github.com/github/docs/edit',
'https://github.com/github/insights-releases/releases/latest',
'https://classroom.github.com/videos',
new RegExp('https://github\\.com/settings/profile'),
new RegExp('https://github\\.com/github/docs/edit'),
new RegExp('https://github\\.com/github/insights-releases/releases/latest'),
new RegExp('https://classroom\\.github.com/videos'),
// Oneoff links that link checkers think are broken but are not.
'https://haveibeenpwned.com/',
'https://www.ilo.org/dyn/normlex/en/f\\?p=NORMLEXPUB:12100:0::NO::P12100_ILO_CODE:P029',
'https://www.ilo.org/dyn/normlex/en/f?p=NORMLEXPUB:12100:0::NO::P12100_ILO_CODE:P029',
'https://www.linkedin.com/company/github',
'https://www.facebook.com/',
'https://ko-fi.com/',