Skip to content

Commit 66302d4

Browse files
authored
chore: improve lint:md-links script and workflow (FuelLabs#1683)
1 parent 50bf779 commit 66302d4

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

.changeset/giant-melons-kiss.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.textlintrc.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"rules": {
55
"no-dead-link": {
66
"ignoreRedirects": true,
7-
"checkRelative": false
7+
"checkRelative": false,
8+
"ignore": ["https://learnmeabitcoin.com/**"]
89
}
910
}
1011
}

scripts/lint-md-links.ts

+3-11
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,14 @@ import { globSync } from 'glob';
66
const mdFiles = globSync('**/*.md', {
77
ignore: [
88
'**/node_modules/**',
9+
'apps/docs/src/api/**', // generated api
910
'**/CHANGELOG.md',
1011
'apps/demo-nextjs/**',
1112
'apps/demo-react-cra/**',
1213
'apps/demo-react-vite/**',
1314
'templates/**',
1415
],
1516
});
16-
const filesWithLintErrors: string[] = [];
17-
mdFiles.forEach((file) => {
18-
try {
19-
execSync(`pnpm textlint ${file}`).toString();
20-
} catch (error) {
21-
filesWithLintErrors.push(file);
22-
}
23-
});
24-
if (filesWithLintErrors.length > 0) {
25-
process.exit(1);
26-
}
17+
18+
execSync(`pnpm textlint ${mdFiles.join(' ')} --parallel --debug`, { stdio: 'inherit' });
2719
})();

0 commit comments

Comments
 (0)