From 66302d42f9a78dff6060aa07ad760bdcb53cedae Mon Sep 17 00:00:00 2001 From: Anderson Arboleya Date: Wed, 24 Jan 2024 10:02:57 -0300 Subject: [PATCH] chore: improve `lint:md-links` script and workflow (#1683) --- .changeset/giant-melons-kiss.md | 2 ++ .textlintrc.json | 3 ++- scripts/lint-md-links.ts | 14 +++----------- 3 files changed, 7 insertions(+), 12 deletions(-) create mode 100644 .changeset/giant-melons-kiss.md diff --git a/.changeset/giant-melons-kiss.md b/.changeset/giant-melons-kiss.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/giant-melons-kiss.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.textlintrc.json b/.textlintrc.json index 2adcb3e6355..526872540e0 100644 --- a/.textlintrc.json +++ b/.textlintrc.json @@ -4,7 +4,8 @@ "rules": { "no-dead-link": { "ignoreRedirects": true, - "checkRelative": false + "checkRelative": false, + "ignore": ["https://learnmeabitcoin.com/**"] } } } diff --git a/scripts/lint-md-links.ts b/scripts/lint-md-links.ts index 964763a790a..defbf33d559 100644 --- a/scripts/lint-md-links.ts +++ b/scripts/lint-md-links.ts @@ -6,6 +6,7 @@ import { globSync } from 'glob'; const mdFiles = globSync('**/*.md', { ignore: [ '**/node_modules/**', + 'apps/docs/src/api/**', // generated api '**/CHANGELOG.md', 'apps/demo-nextjs/**', 'apps/demo-react-cra/**', @@ -13,15 +14,6 @@ import { globSync } from 'glob'; 'templates/**', ], }); - const filesWithLintErrors: string[] = []; - mdFiles.forEach((file) => { - try { - execSync(`pnpm textlint ${file}`).toString(); - } catch (error) { - filesWithLintErrors.push(file); - } - }); - if (filesWithLintErrors.length > 0) { - process.exit(1); - } + + execSync(`pnpm textlint ${mdFiles.join(' ')} --parallel --debug`, { stdio: 'inherit' }); })();