Skip to content

Commit

Permalink
chore: adjust custom lint script
Browse files Browse the repository at this point in the history
  • Loading branch information
mujahidkay committed Oct 3, 2024
1 parent 8b43767 commit 45e38a4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/markdown-js-snippets-linter.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { promises as fs } from 'fs';
import { glob } from 'glob';
import {promises as fs} from 'fs';
import glob from 'glob';
import util from 'util';

const globPromise = util.promisify(glob);

const extractJsSnippets = (markdownContent) => {
const pattern = /```(?:js|javascript)\n([\s\S]*?)```/g;
Expand Down Expand Up @@ -163,7 +165,7 @@ const lintMarkdownFile = async (filePath, fix = false) => {
};
const processFiles = async (globPattern, fix = false) => {
try {
const files = await glob(globPattern);
const files = await globPromise(globPattern);
if (files.length === 0) {
console.error('No files found matching the pattern.');
process.exit(1);
Expand Down

0 comments on commit 45e38a4

Please sign in to comment.