Skip to content

Conversation

@AlexMunoz
Copy link
Contributor

this PR improves the output of tsc --init

TODO: Diagnostics text

Fixes #45714

@ghost
Copy link

ghost commented Sep 17, 2021

CLA assistant check
All CLA requirements met.

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Sep 17, 2021
@orta
Copy link
Contributor

orta commented Sep 17, 2021

This is good work! Note, it doesn't take CLI params passed in via the CLI into account yet too btw:

❯ rm tsconfig.json
❯ node /Users/ortatherox/dev/typescript/typescript-compiler/built/local/tsc.js --init

Created a new tsconfig.json with:
                                                                                                                     TS
  target: es5
  module: commonjs
  strict: true
  esModuleInterop: true


You can learn more at https://aka.ms/tsconfig.json
❯ rm tsconfig.json
❯ node /Users/ortatherox/dev/typescript/typescript-compiler/built/local/tsc.js --init --emitDecoratorMetadata true

Created a new tsconfig.json with:
                                                                                                                     TS
  target: es5
  module: commonjs
  strict: true
  esModuleInterop: true


You can learn more at https://aka.ms/tsconfig.json

@AlexMunoz
Copy link
Contributor Author

Hey @orta emitDecoratorMetadata does not have the showInSimplifiedHelpView attribute. For that reason it does not appear in the output or am I wrong?

$ node ./TypeScript/built/local/tsc.js --init --target es2021 --outDir ./build

Created a new tsconfig.json with:                                                                                       
                                                                                                                     TS 
  target: es2021
  module: commonjs
  outDir: ./build
  strict: true
  esModuleInterop: true


You can learn more at https://aka.ms/tsconfig.json

@orta
Copy link
Contributor

orta commented Sep 17, 2021

Ace, makes sense - yeah, can we drop that please - I changed my mind on it as we both posted at the same time #45714 (comment):

Maybe then we drop the requirement that showInSimplifiedHelpView be set to be true, because then it could act inconsistent with your CLI input.

Otherwise, structurally this looks 💯

@AlexMunoz
Copy link
Contributor Author

I have updated the code! All compileOptions that have been changed + the defaultOptions are now included. Let me know if additional changes are needed... I'm writing a test for the expected outputs.

@orta orta changed the title [WIP]: feat: display the tsconfig generated when running tsc --init feat: display the tsconfig generated when running tsc --init Sep 23, 2021
@orta orta self-assigned this Sep 23, 2021
@orta
Copy link
Contributor

orta commented Oct 1, 2021

Thanks, I've given this a fresh look through and it seems solid to me 👍🏻

@orta orta merged commit 95ef2a5 into microsoft:main Oct 1, 2021
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[CLI DX] Improve the output for tsc --init

3 participants