Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better tsconfig.json generation #48597

Open
isidorn opened this issue Apr 7, 2022 · 2 comments
Open

Better tsconfig.json generation #48597

isidorn opened this issue Apr 7, 2022 · 2 comments
Assignees
Labels
Experience Enhancement Noncontroversial enhancements Rescheduled This issue was previously scheduled to an earlier milestone Suggestion An idea for TypeScript

Comments

@isidorn
Copy link

isidorn commented Apr 7, 2022

The current generation of tsconfig.json is a manual and undiscoverable process inside VS Code. I suggest the following improvements:

  • We should introduce a command "Create tsconfig.json", this command should try to autodetect as much as possible from the workspace, and if needed ask the user some questions via QuickPick API. This command would in the end generate tsconfig.json, similar to how VS Code tries to help with the creation of launch.json
  • "Create tsconfig.json" should be contributed to the command palette and in the explorer context menu (if tsconfig.json is not present)
  • if we want to market some attributes in tsconfig.json we should write them in those files even if they have a default value so users can discover them
  • The commands should be contributed to the Explorer Context Menu - if tsconfig.json can not be found in the workspace.
  • If there is a typescript file open, and there is no tsconfig.json in the repository we should offer the user to automatically to create a tsconfig.json. I think a notification in this case is acceptable.

Step 2: we can consider to make the Problems welcome view contributable. So we can add a button in the problems view to generate tsconfig.json if no errors have been detected in the workspace.

With these improvements I believe we will make it much easier for the users to create a new typescript workspace.

@MartinJohns
Copy link
Contributor

The current generation of tsconfig.json is a manual and undiscoverable process.

https://www.typescriptlang.org/docs/handbook/compiler-options.html

image

@isidorn
Copy link
Author

isidorn commented Apr 7, 2022

@MartinJohns thanks for pointing. I meant inside VS Code. There is no UI for this. I have clarified my initial comment.
Also the --init command does not take into account the current workspace content I believe. And we should make this smarter, based on what the workspace already has.

@RyanCavanaugh RyanCavanaugh added Suggestion An idea for TypeScript Experience Enhancement Noncontroversial enhancements labels Apr 8, 2022
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 4.8.0 milestone Apr 8, 2022
@RyanCavanaugh RyanCavanaugh added the Rescheduled This issue was previously scheduled to an earlier milestone label Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Experience Enhancement Noncontroversial enhancements Rescheduled This issue was previously scheduled to an earlier milestone Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants