TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

Consult `package.json` contents when creating `tsconfig.json` under `tsc --init` to determine better defaults

Open DetachHead opened this issue 4 years ago • 0 comments

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

DetachHead avatar Oct 18 '22 07:10 DetachHead