wasp-lang / wasp

The fastest way to develop full-stack web apps with React & Node.js.
https://wasp-lang.dev
MIT License
13.63k stars 1.18k forks source link

Ensure "user" tsconfig.json files exists and is correct #939

Open sodic opened 1 year ago

sodic commented 1 year ago

To provide proper IDE support (go to definition, type signatures, etc.), Wasp currently generates a "dummy" tsconfig.json file and places it inside the directories with user code (i.e., src/{server,shared,client}). This happens during project creation. Check the docs for more info.

What if the user has since (by accident or malicious intent) deleted the tsconfig.json file. Should Wasp detect this and regenerate it? Old versions aren't a problem, as we've given them a detailed migration guide that solves this problem.

Martinsos commented 1 year ago

Ot what if they modified them?

Martinsos commented 1 year ago

I would call this "should Wasp manage tsconfig.json files"? And I think the answer is yes. It should check if they are there, if they are not generate them, and if they are there but something is wrong with them, fix them -> it might just go for it, or warn user about something, ... . Maybe some parts of tsconfig are managed by user, and some parts are by Wasp.

sodic commented 7 months ago

Wasp 0.12.0 shifted the goals for this issue (i.e., we no longer have different files for configuring TS on client and server), but the rest is still relevant.

infomiho commented 3 months ago

Related to #2169