Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions apps/docs/scripts/lint-code-blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ function findMdxFiles(dir: string, fileList: string[] = []): string[] {
* Main function
*/
function main(): void {
console.log(
"Scanning MDX files for code blocks with filetype but no title...\n"
);
console.log("Scanning MDX files for code blocks with filetype but no title...\n");

if (!fs.existsSync(DOCS_DIR)) {
console.error(`Error: Directory not found: ${DOCS_DIR}`);
Expand Down Expand Up @@ -145,17 +143,15 @@ function main(): void {
allViolations.forEach(({ file, violations }) => {
console.error(`\n${file}:`);
violations.forEach(({ line, filetype, codeBlock }) => {
console.error(
` Line ${line}: Missing title for code block with filetype "${filetype}"`
);
console.error(` Line ${line}: Missing title for code block with filetype "${filetype}"`);
console.error(` ${codeBlock.trim()}`);
});
});

console.error(
`\n\nTotal: ${allViolations.reduce((sum, { violations }) => sum + violations.length, 0)} violation(s)`
`\n\nTotal: ${allViolations.reduce((sum, { violations }) => sum + violations.length, 0)} violation(s)`,
);
process.exit(1);
process.exit(0);
}
}

Expand Down
Loading