cli icon indicating copy to clipboard operation
cli copied to clipboard

Run ESLint in parallel for multiple Nx projects

Open matejchalk opened this issue 10 months ago • 3 comments

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

  • [ ] new parallel?: boolean | number option is added to eslintPlugin initializer
  • [ ] default is to lint projects sequentially - so effective default is parallel: false
  • [ ] if an integer is specified (e.g. parallel: 4), then projects are chunked by this max value
    • [ ] within each chunk, processes are executed in parallel using Promise.all and executeProcess
    • [ ] chunks are executed sequentially
  • [ ] parallel: true enables parallel execution with maximum set to os.cpus().length
  • [ ] for future reusability, a generic function which orchestrates this sequential/parallel process execution is exported from @code-pushup/utils
  • [ ] test performance impact on some large Nx monorepos
  • [ ] document usage in @code-pushup/eslint-plugin

Implementation details

No response

matejchalk avatar Apr 25 '24 11:04 matejchalk