microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
98.27k stars 12.21k forks source link

Allow `--noCheck` on the CLI with top-level `--build` #58336

Open weswigham opened 2 weeks ago

weswigham commented 2 weeks ago

Review comments on #57934 are mostly concerned with --build usage - as an internal option that errors on the CLI/in a config, it can't currently be used with --build without reaching at nonpublic API internals, which also make it difficult to test in a realistic way. That PR adds some psuedo-build tests that baseline current behavior (along the lines of "how will this work once actually exposed"), but current usage is definitely at-your-own-risk (we may even still rename it before it's exposed πŸ˜†) - hopefully that's evident by it being @internal. Specifically, @sheetalkamat has expressed concerns that forcibly running a noCheck build via the API (again, nonpublic, unsupported) and then a normal build on the CLI with --build may not work correctly (in that it may not calculate new diagnostics, since outputs are newer than inputs, and the CLI is unaware the last build was run with differing options). This issue with --build on the CLI and other non---build builds (without --incremental) isn't terribly --noCheck specific, and isn't something you should do - but you may be tempted to do because --noCheck is so useful. Just... don't? Wait for us, please. Our @internals are @internal for a reason. πŸ˜…

In the future PR where we make it CLI-accessible (after we enable it for JS emit), we should:

Additionally, we should:

Those two parts (exposing --noCheck publicly on the CLI and changing --build to invalidate based on options in .buildinfo even when --incremental is false) are likely independent units of future work without a hard dependency on one another, but both are what you want to see to call this issue complete.