Open Asha20 opened 5 years ago
Maybe this is how showConfig should behave all the time?
Yes. If I want to see only what's in the tsconfig, there's already cat
. --showConfig
would be more useful if it showed the effective config.
It also would be amazing if this verbose mode covers the lib
option behavior. What I exactly mean:
Note: If --lib is not specified a default list of libraries are injected. The default libraries injected are:
► For --target ES5: DOM,ES5,ScriptHost
► For --target ES6: DOM,ES6,DOM.Iterable,ScriptHost
It also would be amazing if this verbose mode covers the
lib
option behavior. What I exactly mean:Note: If --lib is not specified a default list of libraries are injected. The default libraries injected are: ► For --target ES5: DOM,ES5,ScriptHost ► For --target ES6: DOM,ES6,DOM.Iterable,ScriptHost
I came here for EXACTLY that... We added "an additional" lib to 1 project... and didn't realise it would REMOVE all the others and ONLY add the 1 lib... and we couldn't find an easy to consume definitive list that explains what all the libs we should be getting if we didn't override lib.. This would help us greatly..
Either that, or add an "appendLib".. because we only want to 'add' never 'replaceAll'
Yeah, judging on the original intent (https://github.com/microsoft/TypeScript/issues/15213) I think we can safely extend --showConfig
.
I think we should detect for stdin on terminal, don't have it then act as today, maybe it's being used to pipe the tsconfig.
Otherwise, we use colors we show the resolved options in gray e.g:
I'd help get a PR for this merged 👍🏻
I don't know if that functionality should be a part of tsc
. And I've create a prototype of tool which can compose full config. - tsconfig-helper. Basically it just uses data from official tsconfig reference.
Please let me know if somebody finds this tool helpful. If so it worths to develop it :)
This would also help confirm when the docs are incorrect, which happens more often than you'd think.
Landed here because I'm wondering what, exactly, the default setting for typeRoots
is.
The documentation for typeRoots
implies the default is "typeRoots": ["./node_modules/@types"]
. However actually setting that in tsconfig.json
seems to break the built-in node type bindings (in VSCode).
Another argument for this is that other tools like eslint
output exactly the full computed config when using their analogous --print-config
. It would be very useful to debug configuration since when changing one tsconfig
property it implicitly affects others.
How hard can this be, considering the configuration is loaded? Trying to debug a Vue 3 config that references/extends at least four other files. What a nightmare.
Really need this for debugging
Search Terms
showConfig
,verbose
,verbosity
Suggestion
Currently, the
--showConfig
option will only print the compiler options that are provided by the giventsconfig.json
.The suggestion is to introduce another command line option to use together with
--showConfig
, for example--verbose
, that would additionally print out the default values of all of the missing compiler options.Use Cases
This new option hopes to make debugging configuration files easier by explicitly displaying the value of every compiler option.
Examples
Given the following folder structure:
And the following
tsconfig.json
:Running the command
tsc --showConfig
produces:Here's an example output of
tsc --showConfig --verbose
. It was derived in the following way:out
,reactNamespace
, andskipDefaultLibCheck
)undefined
.[1] The Handbook says
pretty
should betrue
unless piping or redirecting output to file, so the desired value here may be ambiguous?[2]
locale
andnewLine
are platform-specific.[3]
rootDir
would need to be calculated so it can be displayed.Checklist
My suggestion meets these guidelines: