TypeScript
TypeScript copied to clipboard
Consult `package.json` contents when creating `tsconfig.json` under `tsc --init` to determine better defaults
Bug Report
🔎 Search Terms
tsc init module commonjs
🕗 Version & Regression Information
4.9.0-dev.20221017
⏯ Playground Link
n/a
💻 Code
package.json
{
"name": "asdf",
"version": "1.0.0",
"description": "",
"author": "",
"license": "ISC",
"type": "module",
"devDependencies": {
"typescript": "^4.9.0-dev.20221017"
}
}
🙁 Actual behavior
> npx tsc --init
Created a new tsconfig.json with:
TS
target: es2016
module: commonjs
strict: true
esModuleInterop: true
skipLibCheck: true
forceConsistentCasingInFileNames: true
You can learn more at https://aka.ms/tsconfig
🙂 Expected behavior
it should check the package.json to determine that module should be nodenext or something