Skip to content

Multi-project support for TypeScript plugin #1217

@matejchalk

Description

@matejchalk

User story

I would like to be able to provide multiple tsconfigs to the TypeScript plugin.

  • It would enable me to combine multiple monorepo projects in one report. For Nx, there could be a helper function that auto-detects the tsconfigs. A similar feature is already available for the ESLint and Coverage plugins.
  • It may also come in handy when I have a different configuration for production and testing code (e.g., tsconfig.lib.json vs tsconfig.spec.json).

This feature will also be useful for development in the CLI repo. Currently, the standalone configuration provides tsconfig.base.json, which leads to false positive compilation errors like unknown vitest globals in test files.

Acceptance criteria

  • plugin accepts an array of tsconfig paths
  • plugin exports a helper function that infers the tsconfig paths from the project graph
    • @nx/devkit is dynamically imported as an optional peer dependency (non-Nx users don't need to install it)
  • plugin compiles each TypeScript program individually
  • plugin aggregates results from all programs
  • plugin logs each tsconfig processing, including an error count per tsconfig
  • CLI repo uses Nx helper to accurately type-check all projects

Implementation details

See @code-pushup/eslint-plugin and @code-pushup/coverage-plugin for inspiration.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions