-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
area/typescriptSpecify what technical area given issue relates to. Its goal is to ease filtering good first issues.Specify what technical area given issue relates to. Its goal is to ease filtering good first issues.enhancement
Description
Background
Currently, the check-edit-links script reads the entire directory tree synchronously in the generatePaths function. For large documentation repositories, this could lead to performance issues.
Proposed Solution
Consider using a streaming directory reader like readdir-enhanced or implementing a generator-based solution:
async function* walkDirectory(dir) {
const files = await fs.readdir(dir);
for (const file of files) {
const filePath = path.join(dir, file);
const stats = await fs.stat(filePath);
if (stats.isDirectory()) {
yield* walkDirectory(filePath);
} else {
yield filePath;
}
}
}Benefits
- Memory efficient for large documentation repositories
- Better performance characteristics
- More modern async/await approach
Related PR discussion: #3557 (comment)
Metadata
Metadata
Assignees
Labels
area/typescriptSpecify what technical area given issue relates to. Its goal is to ease filtering good first issues.Specify what technical area given issue relates to. Its goal is to ease filtering good first issues.enhancement
Type
Projects
Status
In progress