From 6343657825643b1be9339f59c5baccadf0203926 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Sat, 8 Jun 2024 06:44:55 -0400 Subject: [PATCH] Update lint-md.js --- gulp-src/lint-md.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/gulp-src/lint-md.js b/gulp-src/lint-md.js index c3fadc25904f..9531b147f510 100644 --- a/gulp-src/lint-md.js +++ b/gulp-src/lint-md.js @@ -82,16 +82,7 @@ function applyCustomRuleFixesHack(result) { // instead of using mdl's fix mechanism. Object.entries(result).forEach(([filePath, issues]) => { - let fileContent; - try { - fileContent = fs.readFileSync(filePath, 'utf8'); - } catch (err) { - if (err.code === 'ENOENT') { - console.warn(`File not found: ${filePath}, ignoring it.`); - return; - } - throw err; - } + let fileContent = fs.readFileSync(filePath, 'utf8'); // Sort issues by lineNumber in descending order const sortedIssues = issues.sort((a, b) => b.lineNumber - a.lineNumber); @@ -160,8 +151,11 @@ function lintMarkdown() { } fix = argv.fix; + const globs = [argv.glob, ...markdownFiles]; + console.log('Globs being used:', globs); + return gulp - .src([argv.glob, ...markdownFiles], { followSymlinks: false }) + .src(globs, { followSymlinks: false }) .pipe(logFiles()) .pipe(through2.obj(markdownLintFile)) .on('end', () => {