Skip to content

Run ESLint in parallel for multiple Nx projects #652

Open
@matejchalk

Description

@matejchalk

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions