Skip to content

Commit 2a02816

Browse files
authored
Merge pull request #1194 from simon04/improve-lint-links
Improve lint:links - exclude support images/links
2 parents d39f83f + 74b5d55 commit 2a02816

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"fetch": "scripts/fetch.sh",
3232
"init:generated": "mkdirp ./generated/loaders && mkdirp ./generated/plugins ",
3333
"lint": "run-s lint:*",
34-
"lint:links": "hyperlink -r build/index.html | ./scripts/check-links.js --skip 10",
34+
"lint:links": "hyperlink -r build/index.html | ./scripts/check-links.js",
3535
"lint:js": "eslint . --ext .js --ext .jsx",
3636
"lint:markdown": "markdownlint --config ./.markdownlint.json *.md ./content/**/*.md",
3737
"lint:social": "alex ./**/*.md",

scripts/check-links.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ function checkLinks(args) {
2222
var name = null;
2323

2424
tap.on('complete', function(res) {
25-
const failures = res.failures;
25+
const failures = res.failures.filter(failure => !failure.diag || !failure.diag.at ||
26+
!failure.diag.at.match(/class="(support__item|support__backers-avatar|support__sponsors-avatar)"/));
2627

2728
if (failures.length > 0) {
2829
console.log(formatFailures(failures));

0 commit comments

Comments
 (0)