microsoft / TypeScript

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

Change the behavior of `tsc` on a tsconfig solution #60479

Open ArnaudBarre opened 6 days ago

ArnaudBarre commented 6 days ago

πŸ” Search Terms

The Vite starters now use a "solution" tsconfig, as documented in the docs.

The issue is that a lot of people are used to run tsc or tsc --noEmit at the root of the project, and now, this silently does nothing.

βœ… Viability Checklist

⭐ Suggestion

I think in that specific case, it should do one of those two things:

πŸ“ƒ Motivating Example

You have three chars less to type? πŸ˜…

More seriously, it's about making project references more used without a familiar command becoming useless

πŸ’» Use Cases

  1. What shortcomings exist with current approaches?

We get some reports like this: https://github.com/vitejs/vite/issues/17585

I suspect a lot more people fall for this, but find the issue before opening an issue

RyanCavanaugh commented 4 days ago

The issue is that a lot of people are used to run tsc or tsc --noEmit at the root of the project, and now, this silently does nothing

There's supposed to be an error if there are zero input files - do you have a sample we can look at to understand why that's not happening?

ArnaudBarre commented 4 days ago

You can run bun create vite@latest && cd vite-project && bun i && bun tsc (choose React and TypeScript)

MartinJohns commented 3 days ago

There's supposed to be an error if there are zero input files

The related issue is still open: #8344

RyanMyrvold commented 2 days ago

There's supposed to be an error if there are zero input files

The related issue is still open: #8344

Thank you!