Skip to content

feat: add cached parallel lint runner - #13

Open
ruidosujeira wants to merge 2 commits into
mainfrom
perflint/add-eslint-cache-support-and-parallel-linting
Open

feat: add cached parallel lint runner#13
ruidosujeira wants to merge 2 commits into
mainfrom
perflint/add-eslint-cache-support-and-parallel-linting

Conversation

@ruidosujeira

Copy link
Copy Markdown
Owner

Summary

  • add a TypeScript-based lint wrapper that shards work across worker threads and persists results via file-entry-cache
  • wire npm scripts and dev dependencies to run the cached wrapper, and ignore generated cache artifacts
  • document the new workflow in the README and provide the worker implementation used by the parallel runner

Testing

  • npm run lint
  • npm run test
  • npm run build

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +318 to +323
const workerPromises = workerInputs.map((input) => spawnWorker(input));
let aggregatedResults: ESLint.LintResult[] = [];

for (const workerPromise of workerPromises) {
const output = await workerPromise;
aggregatedResults = aggregatedResults.concat(output.results);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid unhandled rejections when any worker fails

Each worker lint task is spawned and its promise stored in workerPromises, but the subsequent for loop awaits them one at a time. If any worker other than the first rejects before its turn in the loop, the rejection has no handler in that tick and Node will emit an unhandledRejection (fatal in some runtimes) before the loop ever awaits that promise. This means a fast‑failing worker can terminate the process while the other workers are still running, and the error surfaced via the loop may never execute. Await the promises collectively (e.g. await Promise.all(...)) or attach rejection handlers up front so every worker failure is observed immediately.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant