Repository: next.js
Issue: Next.js sets invalid and irrelevant tsconfig options.
Labels: bug,TypeScript

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

```
    Operating System:
      Platform: linux
      Arch: x64
      Version: #202212290932~1674139725~22.04~ca93ccf SMP PREEMPT_DYNAMIC Thu J
    Binaries:
      Node: 19.6.0
      npm: 9.4.1
      Yarn: 1.22.19
      pnpm: 7.13.5
    Relevant packages:
      next: 13.1.7-canary.5
      eslint-config-next: N/A
      react: 18.2.0
      react-dom: 18.2.0
```

### Which area(s) of Next.js are affected? (leave empty if unsure)

TypeScript

### Link to the code that reproduces this issue

https://stackblitz.com/edit/vercel-next-js-uxjbhb?file=tsconfig.json

### To Reproduce

- Open the StackBlitz link
- Open `tsconfig.json`

### Describe the Bug

Next.js generates undesirable `tsconfig.json` options. Some options are undesirable or unnecessary, others are wrong.

### Expected Behavior

Based on the reasoning emitted by Next.js:

> The following suggested values were added to your `tsconfig.json`. These values **can be changed** to fit your project's needs:
>
> - lib was set to **`dom,dom.iterable,esnext`**

This option matches the `target` if it is defined. I want to omit this.

> - allowJs was set to **`true`**

This option is true if `checkJs` is true. I want to omit this.

> - skipLibCheck was set to **`true`**

This definitely makes sense when generating a default `tsconfig.json`, but there’s not need to enforce this.

> - strict was set to **`false`**

This option makes sense to me.

> - forceConsistentCasingInFileNames was set to **`true`**

This option makes sense to me. Note that this will be default in TypeScript 5. From that version on I want to omit this.

> - noEmit was set to **`true`**

This option makes sense to me.

> - incremental was set to **`true`**

This option makes sense to me.

> - include was set to **`['next-env.d.ts', '**/*.ts', '**/*.tsx']`**

All of these files are included by default. Also `.js` / `.jsx` files are enabled by default if `checkJs` is true. I want to omit this.

> - exclude was set to **`['node_modules']`**

This is default behaviour. I want to omit this.

> The following **mandatory changes** were made to your `tsconfig.json`:
>
> - esModuleInterop was set to **`true`** (requirement for SWC / babel)

This option is only relevant for CJS. I use `"type": "module"` in `package.json`, so this option should be removed.

> - module was set to **`esnext`** (for dynamic import() support)

The correct value if `"type": "module"` in `package.json` is `node16`, not `esnext`.

> - moduleResolution was set to **`node`** (to match webpack resolution)

The correct value if `"type": "module"` in `package.json` is `node16`, not `node`. This is default behaviour when `module` is set to `node16`, so it should be removed.

> - resolveJsonModule was set to **`true`** (to match webpack resolution)

This definitely makes sense when generating a default `tsconfig.json`, but there’s not need to enforce this.

> - isolatedModules was set to **`true`** (requirement for SWC / Babel)

This option makes sense to me personally, but it’s a preference. Users should be able to omit this.

> - jsx was set to **`preserve`** (next.js implements its own optimized jsx transform)

The reasoning makes sense for compiling, but for typechecking purposes, this should match the runtime (classic or automatic) used.

### Which browser are you using? (if relevant)

_No response_

### How are you deploying your application? (if relevant)

_No response_