Skip to content

Commit

Permalink
Update lint-md.js
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin committed Jun 8, 2024
1 parent 7a4b916 commit 6343657
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions gulp-src/lint-md.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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', () => {
Expand Down

0 comments on commit 6343657

Please sign in to comment.