1
0
mirror of synced 2025-12-20 10:28:40 -05:00

Add rule to find hardcoded docs urls (#42212)

This commit is contained in:
Rachael Sewell
2023-09-08 12:42:38 -07:00
committed by GitHub
parent 31d83ed193
commit 5a95792f7d
2 changed files with 35 additions and 4 deletions

View File

@@ -34,6 +34,11 @@ export const githubDocsConfig = {
severity: 'error',
'partial-markdown-files': true,
},
'no-github-docs-domains': {
// GHD020
severity: 'error',
'partial-markdown-files': true,
},
'search-replace': {
severity: 'error',
'severity-local-env': 'warning',
@@ -45,6 +50,34 @@ export const githubDocsConfig = {
search: 'TODOCS',
searchScope: 'all',
},
{
name: 'docs-domain',
message: 'Catch occurrences of docs.gitub.com domain.',
search: 'docs.gitub.com',
searchScope: 'all',
},
{
name: 'help-domain',
message: 'Catch occurrences of help.github.com domain.',
search: 'help.github.com',
searchScope: 'all',
},
{
name: 'preview-domain',
message: 'Catch occurrences of preview.ghdocs.com domain.',
search: 'preview.ghdocs.com',
searchScope: 'all',
},
{
name: 'developer-domain',
message: 'Catch occurrences of developer.github.com domain.',
// Do not match developer.github.com/changes or
// developer.github.com/enterprise/[0-9] or
// developer.github.com/enterprise/{{something}} (e.g. liquid).
// There are occurences that will likely always remain in the content.
searchPattern: '/developer.github.com(?!/(changes|enterprise/([0-9]|{))).*/g',
searchScope: 'all',
},
],
},
}