-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
DiscussionIssues which may not have code impactIssues which may not have code impact
Description
Acknowledgement
- I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion.
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:
- Should we set '"types": []' for 'tsc init'? #39354 - set
typesto[]- yes - Increase default tsc --init target over time #49206, Make tsc --init generate default target to ES6 or higher #39308 - increase default target - also yes
- Enable "useDefineForClassFields" in tsc --init #39311 - set
udfcf- I would argue moot by now since we should set the target high enough that this doesn't matter - Consult
package.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 marginal
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"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
DiscussionIssues which may not have code impactIssues which may not have code impact
{ // 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 } }