Acknowledgement
Comment
Following up from #58417
Note: This is only for argumentless tsc --init. We know that it's physically possible to write text after --init and that text could do something, but that's a separate issue. Since tsc --init should do something, this issue is only about what that something is.
General consensus from the design meeting + external discussion:
- No one likes the huge wall of text
- Not many people like the commented-out options, and certainly not the "terrible idea" commented-out options
"module": "commonjs" is a hard no
Other live issues:
Other things we didn't get to:
rootDir, outDir: These are generally a good idea; no one likes the default side-by-side JS emit buuut there aren't strictly universal conventions here
Proposed new output:
I tried to order this from "most likely to edit" to "least likely to edit"
Acknowledgement
Comment
Following up from #58417
Note: This is only for argumentless
tsc --init. We know that it's physically possible to write text after--initand that text could do something, but that's a separate issue. Sincetsc --initshould do something, this issue is only about what that something is.General consensus from the design meeting + external discussion:
"module": "commonjs"is a hard noOther live issues:
typesto[]- yesudfcf- I would argue moot by now since we should set the target high enough that this doesn't matterpackage.jsoncontents when creatingtsconfig.jsonundertsc --initto determine better defaults #51207 - consultpackage.json- it's not obvious that yourpackage.jsonis configured yet at the time you runtsc --init, this seems marginalOther things we didn't get to:
rootDir,outDir: These are generally a good idea; no one likes the default side-by-side JS emit buuut there aren't strictly universal conventions hereProposed new output:
{ // For more info, see https://aka.ms/tsconfig // Or use the tsc-init wizard: https://aka.ms/tsc-init "compilerOptions": { "target": "es2022", "module": "nodenext", "rootDir": "./src", "outDir": "./dist", // For nodejs, add "node" to this array, // and remove "dom" from "lib" "types": [], "lib": ["dom", "es2022"], // Other outputs "sourceMap": true, // "declaration: true, // Typechecking options "noUncheckedIndexedAccess": true, "exactOptionalPropertyTypes": true, // Style options // "noImplicitReturns": true, // "noImplicitOverride": true, // "noUnusedLocals": true, // "noUnusedParameters": true, // "noFallthroughCasesInSwitch": true, // "noPropertyAccessFromIndexSignature": true, // We recommend all of these options "verbatimModuleSyntax": true, "isolatedModules": true, "moduleDetection": "force", "skipLibCheck": true, "strict": true } }I tried to order this from "most likely to edit" to "least likely to edit"