You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today, 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:
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
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.
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
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
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
Activity
orta commentedon Nov 18, 2020
Possible spaces for exploration:
@tsconfig/basesfor examples to work fromRyanCavanaugh commentedon Nov 18, 2020
Just throwing out what I myself would want to happen,
tsc --initshould give me (in order):AlCalzone commentedon 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
SagnikPradhan commentedon Nov 20, 2020
Making a minimal interactive command similar to that of eslint can be an interesting option too.
softwareCobbler commentedon 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 commentedon Jan 5, 2021
I like the fact that
tsc --initgenerates 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).Jack-Works commentedon Jan 6, 2021
Another problem is that when upgrading, there isn't a "tsc --upgrade" command to add new flags into the
tsconfig.jsonvoxpelli commentedon 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. #4113910 remaining items