From 1fb8b0ec272638d3f1bfb02a9df9b5413fdbce67 Mon Sep 17 00:00:00 2001 From: Ansh Goyal Date: Fri, 18 Oct 2024 17:28:08 +0000 Subject: [PATCH] add coderabbit suggestion --- scripts/markdown/check-markdown.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/markdown/check-markdown.js b/scripts/markdown/check-markdown.js index 3491afc0b80e..c2ff97d8255d 100644 --- a/scripts/markdown/check-markdown.js +++ b/scripts/markdown/check-markdown.js @@ -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}`); } @@ -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; } } });