Skip to content

Commit a9f945e

Browse files
committed
Run validateLinks as part of ./lint
1 parent 3bdbcad commit a9f945e

4 files changed

Lines changed: 29 additions & 34 deletions

File tree

.github/workflows/validate-links.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

dist/validateLinks.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,8 @@ const main = async () => {
7676
}
7777
}
7878
}
79-
if (errors > 0) {
80-
console.error("Link validation found errors");
79+
if (errors > 0)
8180
process.exit(1);
82-
}
8381
};
8482
main().catch((error) => {
8583
console.error(error);

lint

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,31 @@ else
1212
fi
1313
' 0
1414

15-
npm exec -- markdownlint --ignore 'node_modules/' '**/*.md'
16-
npm exec -- prettier --check .
15+
rc=0
16+
17+
echo "validateLinks: ..."
18+
if npm exec -- node dist/validateLinks.js ; then
19+
echo validateLinks: PASS
20+
else
21+
echo validateLinks: FAIL
22+
rc=1
23+
fi
24+
25+
echo "markdownlint: ..."
26+
if npm exec -- markdownlint --ignore 'node_modules/' '**/*.md' ; then
27+
echo "markdownlint: PASS"
28+
else
29+
echo "markdownlint: FAIL"
30+
rc=1
31+
fi
32+
33+
echo "prettier: ..."
34+
if npm exec -- prettier --check . ; then
35+
echo "prettier: PASS"
36+
else
37+
echo "prettier: FAIL"
38+
rc=1
39+
fi
40+
41+
exit $rc
1742
fi

validateLinks.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,7 @@ const main = async () => {
103103
}
104104
}
105105

106-
if (errors > 0) {
107-
console.error("Link validation found errors");
108-
process.exit(1);
109-
}
106+
if (errors > 0) process.exit(1);
110107
};
111108

112109
main().catch((error) => {

0 commit comments

Comments
 (0)