Repository: TypeScript
Issue: Feature request: mode for --build to keep going after a project fails
Labels: Suggestion,In Discussion

# Suggestion

<!--
  Please fill in each section completely. Thank you!
-->

## 🔍 Search Terms

<!--
  💡 Did you know? TypeScript has over 2,000 open suggestions!
  🔎 Please search thoroughly before logging new feature requests as most common ideas already have a proposal in progress.
  The "Common Feature Requests" section of the FAQ lists many popular requests: https://github.com/Microsoft/TypeScript/wiki/FAQ#common-feature-requests

  Replace the text below:
-->

build
keep going
bail
fail fast
project references
large monorepo
-b

https://github.com/microsoft/TypeScript/issues/25600
https://github.com/microsoft/TypeScript/issues/32651

## ✅ Viability Checklist

<!--
   Suggestions that don't meet all these criteria are very, very unlikely to be accepted.
   We always recommend reviewing the TypeScript design goals before investing time writing
   a proposal for ideas outside the scope of the project.
-->
My suggestion meets these guidelines:

* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [x] This wouldn't change the runtime behavior of existing JavaScript code
* [x] This could be implemented without emitting different JS based on the types of the expressions
* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).


## ⭐ Suggestion

<!-- A summary of what you'd like to see added or changed -->

It would be nice if there was a way to configure TypeScript `--build` to try to keep building projects after encountering an error anyway, so that it will continue to build all of the projects regardless of any errors, so more errors in more projects could be seen at one time.

## 📃 Motivating Example

<!--
  If you were announcing this feature in a blog post, what's a short explanation that shows
  a developer why this feature improves the language?
-->

I work in a fairly large monorepo where we have set up project references for all of our projects. We currently have about 80,000 TypeScript files spread out amongst ~1,000 projects. The project dependency graph is fairly tight, with many of these projects sharing many upstream projects as dependencies.

One pain point we've encountered is when making a change to a project that many other projects depend on (or when updating TypeScript or a widely-used package or `@types` package) is that:

a) A complete TypeScript `--build` takes a lot of time to run.
b) Our TypeScript `--build` stops after finding the first set of failures.

This combination makes the feedback loop really slow and painful as we repeatedly have to run the slow build in order to uncover all of the issues to fix or add `@ts-expect-error` comments.

## 💻 Use Cases

<!--
  What do you want to use this for?
  What shortcomings exist with current approaches?
  What workarounds are you using in the meantime?
-->

- Making changes to types in projects that cause errors in many other projects
- Updating TypeScript versions
- Updating packages

Currently, any of these tasks requires slow feedback loops that can make the work drag on for hours since only a handful of projects can be fixed at a time. We are currently doing this by fixing the few projects that TypeScript shows us errors for, and then starting the build again, waiting for it to get farther, and repeating until the build fully passes.