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

--showConfig just like tsc, to help users inspect the config, see what --files is doing #1100

Closed
cspotcode opened this issue Aug 10, 2020 · 0 comments · Fixed by #1243
Closed

Comments

@cspotcode
Copy link
Collaborator

ts-node --showConfig can emit output similar to tsc --showConfig, displaying ts-node's configuration: both ts-node flags and tsconfig flags, emitted in tsconfig format with our nested "ts-node" object.

Looks like TypeScript does it like this:

sys.write(JSON.stringify(convertToTSConfig(configParseResult, configFileName, sys), null, 4) + sys.newLine);

https://github.com/microsoft/TypeScript/blob/master/src/executeCommandLine/executeCommandLine.ts

Unfortunately convertToTSConfig is @internal, so we will need to be confident that it won't break. It was added in TS 3.2; I don't know if the function signature has stayed the same.

We'll also need a ts-node equivalent of convertToTSConfig which can generate our ts-node sub-object. I think it should mostly be verbatim, but some things like paths will need to be computed correctly.

cspotcode added a commit that referenced this issue Feb 24, 2021
* add --show-config which is like a ts-node equivalent of tsc --showConfig

* fix and add tests

* try to fix test

* fix tests and sneak in an update to ts 4.2 since it affects the output
of --showConfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant