GeezerVison is showing github.com — Review the project setup experience · Issue #41580 · microsoft/TypeScript
Review the project setup experience #41580DescriptionToday, tsc --init creates a big-ol' file that is super intimidating. We try to provide comments and blocks of sections to give people a clear separation of config concerns. We also provide a link to https://aka.ms/tsconfig.json.
We also have a belief that most people don't even use tsc --init.
That said, there are problems, and tsc --init doesn't make it totally clear what the "best practices" are for starting a project. Things that are missing:
- Project layout guidance (e.g.
src, tsconfig naming)
- "well known"/"blessed" flags as opposed to just ONE BIG PAGE of ALL THE FLAGS 😨
- Easy way to find the information regardless of whether a user used
tsc --init
In short:
- Docs for tsconfig.json "getting started"
- Link to that in generated tsconfig.json
- Re-evaluate generated tsconfig content.
Reacted by Joe Percy, Erik, Joseph Kohlmann, Marko Kaznovac, Bill Cauchois, Kirill Groshkov, Mark Adamson, Edoardo Luppi, Kyrylo Taran, gaowanqiu and 24 more Reacted by Bat Activityorta commented on Nov 18, 2020 Possible spaces for exploration:
- Make it interactive and/or rely on
@tsconfig/bases for examples to work from
- A different way to show groups of common tsconfig options (e.g. "these are all the things most node projects use") in the reference
- Better categorization of tsconfig opts
RyanCavanaugh commented on Nov 18, 2020 Just throwing out what I myself would want to happen, tsc --init should give me (in order):
- All of the "you need to tell us" settings written out at the top (target, module, etc)
- Opinionated defaults where necessary to prevent undesirable behavior (e.g. `outDir: "./lib" to prevent in-placing .js files)
- All of our "recommended" options in a block with "We recommend these settings for new projects"
- The most-commonly-changed settings (lint-ish rules, etc) after that
AlCalzone commented on Nov 19, 2020
My first thought, too. You could ask the user...
...what runtime he is targeting (Browser w/ or w/o React, Node.js)
...which minimum version (e.g. to set up target/lib)
...whether potential undefined values should be flagged (to nudge users towards the goodness that is hidden behind the somewhat intimidating name --strict)
...etc Reacted by __, Waseem Dahman, t7yang and Jayden Pearse SagnikPradhan commented on Nov 20, 2020 Making a minimal interactive command similar to that of eslint can be an interesting option too. softwareCobbler commented on Nov 24, 2020 I figure you have telemetry for this; but one more datapoint for you: I use tsc --init all the time and just "uncomment out" all the strict options. Max safety, I want all the red squigglies and inference you can muster. renanmontebelo commented on Jan 5, 2021 I like the fact that tsc --init generates a file with all flags explicitly listed, even if most are commented out. However, I was surprised today when I noticed the commented out flags do not necessarily reflect default values. For instance, the following line is generated
// "sourceMap": true, /* Generates corresponding '.map' file. */
when the actual default value is false. My suggestion is that these values should reflect default values and hence be fully self-documented (no need to visit a webpage to check what the default values are). Reacted by Simon Karman, Lukas Elmer, Mariusz Pawelski, Chris Krycho, Bruno Heridet, Yehyoung Kang, Branch Vincent and Steven Jack-Works commented on Jan 6, 2021 Another problem is that when upgrading, there isn't a "tsc --upgrade" command to add new flags into the tsconfig.json Reacted by Renan Montebelo, Jan Procházka, Simon Karman and Pelle Wessman voxpelli commented on Feb 17, 2021 The default value of some of the flags is also confusing for people who are new to the flags and trying to set it up for themselves manually or through tsc --init, many assuming that flags are used to deviate from the recommended route, not used to stick to the recommended route. See eg. #41139
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|