Skip to content

Commit

Permalink
add coderabbit suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
anshgoyalevil committed Oct 18, 2024
1 parent c676e3d commit 1fb8b0e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/markdown/check-markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function validateBlogs(frontmatter) {
});

// Validate date format
if (frontmatter.date && isNaN(Date.parse(frontmatter.date))) {
if (frontmatter.date && Number.isNaN(Date.parse(frontmatter.date))) {
errors.push(`Invalid date format: ${frontmatter.date}`);
}

Expand Down Expand Up @@ -126,6 +126,7 @@ function checkMarkdownFiles(folderPath, validateFunction, relativePath = '') {
if (errors) {
console.log(`Errors in file ${relativeFilePath}:`);
errors.forEach(error => console.log(`${error}\n`));
process.exitCode = 1;
}
}
});
Expand Down

0 comments on commit 1fb8b0e

Please sign in to comment.