From 1cd33f52cab74c3ede2c3dda18b1de6fe2a496bf Mon Sep 17 00:00:00 2001 From: CDeltakai Date: Tue, 20 May 2025 17:47:28 +1000 Subject: [PATCH 1/3] fix: collectMarkdown now returns correct paths - Use `fs.readdirSync(..., { encoding: 'utf8', recursive: true })` to keep sub-folder paths intact and avoid the `string | Buffer` type issue that broke Prettier in Zeta-House-Docs. --- src/utils.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 2a11898..15298a9 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -116,12 +116,21 @@ 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)); } +// 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)); +// } + + /** * Check if a command exists in the system PATH. * From 8c9dbb634dbfbce36dafd7e8cc09dc3ad7a75e07 Mon Sep 17 00:00:00 2001 From: CDeltakai Date: Tue, 20 May 2025 17:48:18 +1000 Subject: [PATCH 2/3] fix: removed unncessary comment --- src/utils.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 15298a9..ad4ffe4 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -120,17 +120,9 @@ function collectMarkdown(dir: string): string[] { return files .filter((f) => /\.(md|mdx)$/i.test(f)) - .map((f) => path.join(dir, f)); + .map((f) => path.join(dir, f)); } -// 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)); -// } - - /** * Check if a command exists in the system PATH. * From 7a709f4b22e2e47246ebd9b937a1bd3b0432889f Mon Sep 17 00:00:00 2001 From: CDeltakai Date: Tue, 20 May 2025 17:49:32 +1000 Subject: [PATCH 3/3] 0.2.8 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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",