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

Interactive init #10964

Closed
tinganho opened this issue Sep 17, 2016 · 3 comments
Closed

Interactive init #10964

tinganho opened this issue Sep 17, 2016 · 3 comments
Labels
In Discussion Not yet reached consensus Suggestion An idea for TypeScript

Comments

@tinganho
Copy link
Contributor

I think --initcould be improved a lot if TypeScript provided an interactive init. People don't know TS flags at the beginning, so it is not wise to require them knowing the flags before creating a tsconfig.json file:

tsc --init
This utility will walk you through creating a tsconfig.json file.
It only covers the most common items, and tries to guess sensible defaults.
--
Which JS compilation target do you want to target?
target(default=es5, alt=es3,es6)? es5

--
Strict null checking provides null type checking capability. `null` and `undefined` will be types that are not assignable to all types anymore. They are only assignable to itself or `any` .
Turn on 'strictNullChecking' flag(default=yes, alt=no)?

--
No implicit any flag helps you from implicitly typing `anys` in parameters and local variables. With this flag only explicit `anys` will be allowed
Turn on 'noImplicitAny' flag(default=yes, alt=no)? yes

--
Is your project a NodeJS based project(default=no, alt=yes)? yes

Downloading types for NodeJS 
npm install @types/node --save
------
======> 13% 
Downloading @types/node
------

@aluanhaddad
Copy link
Contributor

Great idea. This looks a lot like JSPM init. It could do clever things like ask what file your entry point will be called and if you respond index.js it would set "allowJs": true

@RyanCavanaugh RyanCavanaugh added In Discussion Not yet reached consensus Help Wanted You can do this labels Sep 19, 2016
@RyanCavanaugh RyanCavanaugh added Suggestion An idea for TypeScript and removed Help Wanted You can do this labels Sep 26, 2016
@codefoster
Copy link

I would prefer it be called more like npm. npm init initiates it interactively or npm init -y takes all of the defaults. If I want to change my defaults (in npm that's things like my name and my preferred license) then I modify (in the command line or in a text editor) my .npmrc file and those defaults are used every time I do npm init -y.
Currently I use tsc --init and then reference a OneNote that I use to remind myself which configuration options I like to change.

@RyanCavanaugh
Copy link
Member

Declining due to low feedback and lack of interest on our side in implementing. We're not really sure what kind of questions would get asked and we like that there's one place to put our "recommended" config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
In Discussion Not yet reached consensus Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants