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

Suggestion: tsc init to generate tsconfig.json #3079

Closed
alexeagle opened this issue May 8, 2015 · 5 comments
Closed

Suggestion: tsc init to generate tsconfig.json #3079

alexeagle opened this issue May 8, 2015 · 5 comments
Labels
Fixed A PR has been merged for this issue Help Wanted You can do this Suggestion An idea for TypeScript

Comments

@alexeagle
Copy link
Contributor

I know the tsconfig.json file is small, but it's a distraction to have to go look up a copy-paste example while you're starting a new project in VSCode. And that makes the screencast not as cool :)

npm and other javascripty tools have an init command which creates your basic config file structure. Ideally it would contain all the default options explicitly spelled out, and including documentation inline on how to set the knobs correctly (but I know this is challenging in raw JSON)

the TypeStrong atom editor plugin generates the tsconfig.json, but I didn't find another way (at least in a couple minutes of searching, which is all an end user would do at this point)

@mhegazy mhegazy added Suggestion An idea for TypeScript In Discussion Not yet reached consensus labels May 8, 2015
@alexeagle
Copy link
Contributor Author

Wider tool support for http://json.schemastore.org/tsconfig might be another way to satisfy this

@RyanCavanaugh RyanCavanaugh added Help Wanted You can do this and removed In Discussion Not yet reached consensus labels May 18, 2015
@RyanCavanaugh RyanCavanaugh added this to the Community milestone May 19, 2015
@RyanCavanaugh
Copy link
Member

Accepted, accepting PRs. This would be super useful.

Ideally you could write e.g. tsc --init --module amd foo.ts and have a tsconfig.json file be emitted that was equivalent to the command line. That opens up an easy migration path.

🚲 🏠 - should the generated file have all the defaults emitted into it so it's easier to change, or be minimal so it's not so large? Or some subset of the common options people want to change?

@alexeagle
Copy link
Contributor Author

for painting the bikeshed: I think the ideal would be to mimic the VSCode
settings UI: a file with comments explaining the settings. That means tsc
needs to pipe the file through JSMin before parsing it (
http://www.quora.com/How-do-I-write-comments-inside-a-JSON-document)
But I think that's a good idea anyway: since a team shares the
tsconfig.json as a means to collaboratively configure the build, they
ought to be able to add comments there to explain reasoning, point to bugs,
etc.

Not sure I'll have the time to prepare a PR myself though...

On Tue, May 19, 2015 at 9:39 AM Ryan Cavanaugh notifications@github.com
wrote:

Accepted, accepting PRs. This would be super useful.

Ideally you could write e.g. tsc --init --module amd foo.ts and have a
tsconfig.json file be emitted that was equivalent to the command line. That
opens up an easy migration path.

[image: 🚲] [image: 🏠] - should the generated file have all the
defaults emitted into it so it's easier to change, or be minimal so it's
not so large? Or some subset of the common options people want to change?


Reply to this email directly or view it on GitHub
#3079 (comment)
.

@mhegazy
Copy link
Contributor

mhegazy commented May 20, 2015

I do not think we need JSMin, we already have a JS parser/emitter :D

@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Aug 26, 2015
@mhegazy
Copy link
Contributor

mhegazy commented Aug 26, 2015

Thanks @tinganho!

@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Fixed A PR has been merged for this issue Help Wanted You can do this Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants