diff --git a/package-lock.json b/package-lock.json index 2553a80..46d2aec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@matrixai/lint", - "version": "0.2.7", + "version": "0.2.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@matrixai/lint", - "version": "0.2.7", + "version": "0.2.8", "license": "Apache-2.0", "dependencies": { "@eslint/compat": "^1.2.5", diff --git a/package.json b/package.json index 97c304a..8264cc0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@matrixai/lint", - "version": "0.2.7", + "version": "0.2.8", "author": "Roger Qiu", "description": "Org wide custom eslint rules", "license": "Apache-2.0", diff --git a/src/utils.ts b/src/utils.ts index 2a11898..ad4ffe4 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -116,10 +116,11 @@ function findUserESLintConfig(repoRoot = process.cwd()): string | undefined { * @returns An array of paths to Markdown files. */ function collectMarkdown(dir: string): string[] { - const entries = fs.readdirSync(dir, { withFileTypes: true, recursive: true }); - return entries - .filter((e) => e.isFile() && /\.(md|mdx)$/i.test(e.name)) - .map((e) => path.join(dir, e.name)); + const files = fs.readdirSync(dir, { encoding: 'utf8', recursive: true }); + + return files + .filter((f) => /\.(md|mdx)$/i.test(f)) + .map((f) => path.join(dir, f)); } /**