code-pushup / cli

A CLI to run all kinds of code quality measurements to align your team with company goals
https://code-pushup.dev
MIT License
255 stars 14 forks source link

Run ESLint in parallel for multiple Nx projects #652

Open matejchalk opened 6 months ago

matejchalk commented 6 months ago

User story

For large Nx monorepos, it could help speed up Code PushUp runs if ESLint could run on different projects in parallel instead of sequentially. Adding an option to enable parallel execution, and even set the max number of processes, would give Code PushUp users more flexibility to optimize for performance. A lot like Nx's --parallel flag.

Acceptance criteria

Implementation details

No response

getlarge commented 6 months ago

Have you considered using the worker_threads module from node to run in parallel? I would not be surprised if Nx would use a similar approach where the integer passed to parallel is the number of workers.

getlarge commented 6 months ago

Have you considered using the worker_threads module from node to run in parallel? I would not be surprised if Nx would use a similar approach where the integer passed to parallel is the number of workers.

My assumption was incorrect!

matejchalk commented 6 months ago

I guess that could also work. I'm honestly not sure what the pros/cons would be of multi-threading instead of multi-processing. Since we're already using processes on the project (eslint is executed as a process, and we have a convenient executeProcess wrapper which promisifes spawn from child_process module), they should be more straightforward to implement. But could be worth investigating threads as an alternative.