Skip to content

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

Open
@DetachHead

Description

@DetachHead

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions