Add rule to find hardcoded docs urls (#42212)
This commit is contained in:
@@ -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',
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user