Skip to content

Commit

Permalink
docs: Lint links (#1510)
Browse files Browse the repository at this point in the history
  • Loading branch information
amannn authored Nov 7, 2024
1 parent c4d6859 commit e44fa16
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 13 deletions.
11 changes: 11 additions & 0 deletions docs/lintLinks.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import glob from 'fast-glob';
import {printErrors, scanURLs, validateFiles} from 'next-validate-link';

const scanned = await scanURLs();

printErrors(
await validateFiles(await glob('src/pages/docs/**/*.{md,mdx}'), {
scanned
}),
true
);
4 changes: 3 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"scripts": {
"dev": "next dev",
"lint": "eslint src && tsc && prettier src --check",
"lint": "eslint src && tsc && prettier src --check && node lintLinks.mjs",
"test": "echo 'No tests yet'",
"build": "next build",
"sitemap": "next-sitemap",
Expand Down Expand Up @@ -34,8 +34,10 @@
"autoprefixer": "^10.4.19",
"eslint": "^9.11.1",
"eslint-config-molindo": "^8.0.0",
"fast-glob": "^3.3.2",
"globals": "^15.11.0",
"next-sitemap": "^4.2.3",
"next-validate-link": "^1.3.0",
"prettier": "^3.3.3",
"typescript": "^5.5.3"
},
Expand Down
56 changes: 44 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e44fa16

Please sign in to comment.